mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-11 09:27:56 -04:00
Update utils to 12.0.0
Includes:
- [x] https://github.com/alphagov/notifications-utils/pull/94 (breaking
changes which are responsible for all the changes to the API in
this PR)
The test for `get_sms_fragment_count` has been removed because this
method is already tested in utils here:
ac20f7e99e/tests/test_base_template.py (L140-L159)
This commit is contained in:
@@ -129,7 +129,7 @@ def test_send_notification_with_placeholders_replaced(notify_api, sample_email_t
|
||||
queue="send-email"
|
||||
)
|
||||
assert response.status_code == 201
|
||||
assert response_data['body'] == 'Hello Jo\nThis is an email from GOV.UK'
|
||||
assert response_data['body'] == u'Hello Jo\nThis is an email from GOV.\u200BUK'
|
||||
assert response_data['subject'] == 'Jo'
|
||||
|
||||
|
||||
|
||||
@@ -18,14 +18,14 @@ from tests.app.conftest import sample_notification, sample_template, sample_emai
|
||||
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 content.rendered == template.content
|
||||
assert str(content) == template.content
|
||||
|
||||
|
||||
def test_create_content_for_notification_with_placeholders_passes(sample_template_with_placeholders):
|
||||
template = Template.query.get(sample_template_with_placeholders.id)
|
||||
content = create_content_for_notification(template, {'name': 'Bobby'})
|
||||
assert content.content == template.content
|
||||
assert 'Bobby' in content.rendered
|
||||
assert 'Bobby' in str(content)
|
||||
|
||||
|
||||
def test_create_content_for_notification_fails_with_missing_personalisation(sample_template_with_placeholders):
|
||||
|
||||
@@ -711,7 +711,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.UK'
|
||||
assert notification['body'] == 'Hello world\nThis is an email from GOV.\u200BUK'
|
||||
assert notification['subject'] == 'world'
|
||||
assert notification['content_char_count'] is None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user