Sanitize HTML in templates using utils

We can no longer trust that the content of templates stored in the
database is safe.

Utils now has code to sanitise the content of templates.

This commit:
- updates utils to bring this code in
- modifies some integration tests to make sure everything is working
  (there are more extensive unit tests in utils)
This commit is contained in:
Chris Hill-Scott
2017-01-19 12:22:24 +00:00
parent 689c199b8c
commit 597c6da857
5 changed files with 12 additions and 12 deletions

View File

@@ -479,7 +479,7 @@ def test_should_show_preview_letter_message(
mock_get_service_letter_template.assert_called_with(service_id, template_id)
assert mock_letter_preview.call_args[0][0]['message'] == (
'<h2>Subject</h2>\n'
'<p>Your vehicle tax is about to expire</p>'
'<p>Template &lt;em&gt;content&lt;/em&gt; with &amp; entity</p>'
)