mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
This commit is contained in:
@@ -227,7 +227,9 @@ def test_placeholder_html_rendering_from_string(env):
|
||||
"Event website: [{event}](https://example.org/{event_slug})\n\n"
|
||||
"Other website: [{event}]({meta_Website})\n\n"
|
||||
"URL: {url}\n\n"
|
||||
"URL with text: <a href=\"{url}\">Test</a>"
|
||||
"URL with text: <a href=\"{url}\">Test</a>\n\n"
|
||||
"URL with params: https://example.com/form?action=foo&eventid={event_slug}\n\n"
|
||||
"URL with params and text: [Link & Text](https://example.com/form?action=foo&eventid={event_slug})\n\n"
|
||||
})
|
||||
djmail.outbox = []
|
||||
event, user, organizer = env
|
||||
@@ -249,6 +251,8 @@ def test_placeholder_html_rendering_from_string(env):
|
||||
assert '**Meta**: *Beep*' in djmail.outbox[0].body
|
||||
assert 'URL: https://google.com' in djmail.outbox[0].body
|
||||
assert 'URL with text: <a href="https://google.com">Test</a>' in djmail.outbox[0].body
|
||||
assert 'URL with params: https://example.com/form?action=foo&eventid=dummy' in djmail.outbox[0].body
|
||||
assert 'URL with params and text: [Link & Text](https://example.com/form?action=foo&eventid=dummy)' in djmail.outbox[0].body
|
||||
assert '<' not in djmail.outbox[0].body
|
||||
assert '&' not in djmail.outbox[0].body
|
||||
html = _extract_html(djmail.outbox[0])
|
||||
@@ -272,3 +276,13 @@ def test_placeholder_html_rendering_from_string(env):
|
||||
r'URL with text: <a href="https://google.com" rel="noopener" style="[^"]+" target="_blank">Test</a>',
|
||||
html
|
||||
)
|
||||
assert re.search(
|
||||
r'URL with params: <a href="https://example.com/form\?action=foo&eventid=dummy" rel="noopener" '
|
||||
r'style="[^"]+" target="_blank">https://example.com/form\?action=foo&eventid=dummy</a>',
|
||||
html
|
||||
)
|
||||
assert re.search(
|
||||
r'URL with params and text: <a href="https://example.com/form\?action=foo&eventid=dummy" rel="noopener" '
|
||||
r'style="[^"]+" target="_blank">Link & Text</a>',
|
||||
html
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user