mirror of
https://github.com/GSA/notifications-api.git
synced 2026-07-21 08:30:00 -04:00
Bump utils to improve plain text email formatting
Brings in: - [x] https://github.com/alphagov/notifications-utils/pull/438 - [x] https://github.com/alphagov/notifications-utils/pull/450 - [x] https://github.com/alphagov/notifications-utils/pull/454 Changes: - https://github.com/alphagov/notifications-utils/compare/25.3.0...26.2.0
This commit is contained in:
@@ -117,7 +117,7 @@ def test_should_send_personalised_template_to_correct_email_provider_and_persist
|
||||
'"Sample service" <sample.service@test.notify.com>',
|
||||
'jo.smith@example.com',
|
||||
'Jo <em>some HTML</em>',
|
||||
body='Hello Jo\nThis is an email from GOV.\u200bUK with <em>some HTML</em>',
|
||||
body='Hello Jo\nThis is an email from GOV.\u200bUK with <em>some HTML</em>\n',
|
||||
html_body=ANY,
|
||||
reply_to_address=None
|
||||
)
|
||||
|
||||
@@ -136,7 +136,7 @@ def test_send_notification_with_placeholders_replaced(notify_api, sample_email_t
|
||||
queue="send-email-tasks"
|
||||
)
|
||||
assert response.status_code == 201
|
||||
assert response_data['body'] == u'Hello Jo\nThis is an email from GOV.\u200BUK'
|
||||
assert response_data['body'] == u'Hello Jo\nThis is an email from GOV.UK'
|
||||
assert response_data['subject'] == 'Jo'
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ def test_send_notification_with_placeholders_replaced(notify_api, sample_email_t
|
||||
'* Jo\n'
|
||||
'* John\n'
|
||||
'* Josephine\n'
|
||||
'This is an email from GOV.\u200BUK'
|
||||
'This is an email from GOV.UK'
|
||||
),
|
||||
'Jo, John and Josephine',
|
||||
),
|
||||
@@ -156,7 +156,7 @@ def test_send_notification_with_placeholders_replaced(notify_api, sample_email_t
|
||||
6,
|
||||
(
|
||||
'Hello 6\n'
|
||||
'This is an email from GOV.\u200BUK'
|
||||
'This is an email from GOV.UK'
|
||||
),
|
||||
'6',
|
||||
),
|
||||
|
||||
@@ -579,7 +579,7 @@ def test_get_notification_by_id_returns_merged_template_content_for_email(
|
||||
|
||||
notification = json.loads(response.get_data(as_text=True))['data']['notification']
|
||||
assert response.status_code == 200
|
||||
assert notification['body'] == 'Hello world\nThis is an email from GOV.\u200BUK'
|
||||
assert notification['body'] == 'Hello world\nThis is an email from GOV.UK'
|
||||
assert notification['subject'] == 'world'
|
||||
assert notification['content_char_count'] is None
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ def test_get_notification_by_id_with_placeholders_returns_200(
|
||||
'status': '{}'.format(sample_notification.status),
|
||||
'template': expected_template_response,
|
||||
'created_at': sample_notification.created_at.strftime(DATETIME_FORMAT),
|
||||
'body': "Hello Bob\nThis is an email from GOV.\u200bUK",
|
||||
'body': "Hello Bob\nThis is an email from GOV.UK",
|
||||
"subject": "Bob",
|
||||
'sent_at': sample_notification.sent_at,
|
||||
'completed_at': sample_notification.completed_at(),
|
||||
|
||||
@@ -313,7 +313,7 @@ def test_post_email_notification_returns_201(client, sample_email_template_with_
|
||||
assert notification.reference is None
|
||||
assert notification.reply_to_text is None
|
||||
assert resp_json['content']['body'] == sample_email_template_with_placeholders.content \
|
||||
.replace('((name))', 'Bob').replace('GOV.UK', u'GOV.\u200bUK')
|
||||
.replace('((name))', 'Bob')
|
||||
assert resp_json['content']['subject'] == sample_email_template_with_placeholders.subject \
|
||||
.replace('((name))', 'Bob')
|
||||
assert resp_json['content']['from_email'] == "{}@{}".format(
|
||||
|
||||
Reference in New Issue
Block a user