Merge pull request #1104 from alphagov/bump-utils-addresses-in-letters

Handle partial letter addresses more gracefully
This commit is contained in:
Chris Hill-Scott
2017-02-06 12:52:46 +00:00
committed by GitHub
3 changed files with 7 additions and 5 deletions

View File

@@ -29,4 +29,4 @@ whitenoise==1.0.6 #manages static assets
# pin to minor version 3.1.x
notifications-python-client>=3.1,<3.2
git+https://github.com/alphagov/notifications-utils.git@13.2.1#egg=notifications-utils==13.2.1
git+https://github.com/alphagov/notifications-utils.git@13.3.1#egg=notifications-utils==13.3.1

View File

@@ -444,8 +444,10 @@ def test_should_show_preview_letter_message(
assert response.status_code == 200
assert response.content_type == expected_content_type
mock_get_service_letter_template.assert_called_with(service_id, template_id)
assert mock_letter_preview.call_args[0][0]['subject'] == (
'Subject'
)
assert mock_letter_preview.call_args[0][0]['message'] == (
'<h2>Subject</h2>\n'
'<p>Template &lt;em&gt;content&lt;/em&gt; with &amp; entity</p>'
)

View File

@@ -100,10 +100,10 @@ def test_should_show_preview_letter_templates(
assert response.status_code == 200
assert response.content_type == expected_content_type
mock_get_service_email_template.assert_called_with(service_id, template_id, **extra_view_args)
print(mock_letter_preview)
print(mock_letter_preview.call_args)
assert mock_letter_preview.call_args[0][0]['subject'] == (
"Your <span class='placeholder'>((thing))</span> is due soon"
)
assert mock_letter_preview.call_args[0][0]['message'] == (
"<h2>Your <span class='placeholder'>((thing))</span> is due soon</h2>\n"
"<p>Your vehicle tax expires on <span class='placeholder'>((date))</span></p>"
)