Use same template to validate and send notification

To be absolutely sure that we can send a message we should also validate
it using the same template class that we use to render it.
This commit is contained in:
Chris Hill-Scott
2020-04-06 14:25:43 +01:00
parent 8c8c8b6328
commit 025ac3ea89
9 changed files with 136 additions and 46 deletions

View File

@@ -29,7 +29,7 @@ from tests.app.db import create_service, create_template
def test_create_content_for_notification_passes(sample_email_template):
template = Template.query.get(sample_email_template.id)
content = create_content_for_notification(template, None)
assert str(content) == template.content
assert str(content) == template.content + '\n'
def test_create_content_for_notification_with_placeholders_passes(sample_template_with_placeholders):