tests: use or remove |safe now that autoescape is off (#21343)

This commit is contained in:
Thomas NOËL 2018-01-22 17:51:42 +01:00 committed by Frédéric Péters
parent 19227e7a6d
commit c8a06c48f3
1 changed files with 7 additions and 2 deletions

View File

@ -715,6 +715,11 @@ def test_register_comment(pub):
formdata.evolution[-1]._display_parts = None
assert formdata.evolution[-1].display_parts()[-1] == '<div>1 &lt; 3</div>'
item.comment = '{{ foo|safe }}'
item.perform(formdata)
formdata.evolution[-1]._display_parts = None
assert formdata.evolution[-1].display_parts()[-1] == '<div>1 < 3</div>'
item.comment = '[foo]'
item.perform(formdata)
formdata.evolution[-1]._display_parts = None
@ -857,8 +862,8 @@ def test_email(pub, emails):
# template for subject or body (Django)
emails.empty()
item.subject = '{{ bar|safe }}'
item.body = '{{ foo|safe }}'
item.subject = '{{ bar }}'
item.body = '{{ foo }}'
item.perform(formdata)
get_response().process_after_jobs()
assert emails.count() == 1