Avoid call to database to get template in persist_notifications

This commit is contained in:
Pea Tyczynska
2019-01-14 17:45:56 +00:00
parent 685bff40d1
commit 5ebeb9937a
7 changed files with 13 additions and 6 deletions

View File

@@ -90,6 +90,7 @@ def test_send_one_off_notification_calls_persist_correctly_for_sms(
persist_mock.assert_called_once_with(
template_id=template.id,
template_version=template.version,
template_postage=None,
recipient=post_data['to'],
service=template.service,
personalisation={'name': 'foo'},
@@ -127,6 +128,7 @@ def test_send_one_off_notification_calls_persist_correctly_for_email(
persist_mock.assert_called_once_with(
template_id=template.id,
template_version=template.version,
template_postage=None,
recipient=post_data['to'],
service=template.service,
personalisation={'name': 'foo'},
@@ -153,6 +155,7 @@ def test_send_one_off_notification_calls_persist_correctly_for_letter(
template = create_template(
service=service,
template_type=LETTER_TYPE,
postage='first',
subject="Test subject",
content="Hello (( Name))\nYour thing is due soon",
)
@@ -174,6 +177,7 @@ def test_send_one_off_notification_calls_persist_correctly_for_letter(
persist_mock.assert_called_once_with(
template_id=template.id,
template_version=template.version,
template_postage='first',
recipient=post_data['to'],
service=template.service,
personalisation=post_data['personalisation'],