From efd976e32e22dfeaefbe7dd7e5e6eeff6c3e2b46 Mon Sep 17 00:00:00 2001 From: Leo Hemsted Date: Mon, 20 Feb 2017 12:03:16 +0000 Subject: [PATCH] downgrade non-gsm chars in SMS previews bump utils to 13.8.0 we still save the content as the user intended, and they'll still see that content in the text field if they go to edit the template, but the SMS previews will appear as they will on a user's phone --- requirements.txt | 2 +- tests/app/main/views/test_templates.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/requirements.txt b/requirements.txt index 22dd3c13e..5637048f6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -33,4 +33,4 @@ notifications-python-client>=3.1,<3.2 awscli>=1.11,<1.12 awscli-cwlogs>=1.4,<1.5 -git+https://github.com/alphagov/notifications-utils.git@13.7.0#egg=notifications-utils==13.7.0 +git+https://github.com/alphagov/notifications-utils.git@13.8.0#egg=notifications-utils==13.8.0 diff --git a/tests/app/main/views/test_templates.py b/tests/app/main/views/test_templates.py index 29b9173ee..ab336482f 100644 --- a/tests/app/main/views/test_templates.py +++ b/tests/app/main/views/test_templates.py @@ -32,13 +32,14 @@ def test_should_show_page_for_one_template( mock_get_service_template.assert_called_with(service_one['id'], template_id) -def test_should_show_sms_template_without_downgrading_unicode_characters( +def test_should_show_sms_template_with_downgraded_unicode_characters( logged_in_client, mocker, service_one, fake_uuid, ): - msg = 'here:\tare some “fancy quotes” and non\u200Bbreaking\u200Bspaces' + msg = 'here:\tare some “fancy quotes” and zero\u200Bwidth\u200Bspaces' + rendered_msg = 'here: are some "fancy quotes" and zerowidthspaces' mocker.patch( 'app.service_api_client.get_service_template', @@ -52,7 +53,7 @@ def test_should_show_sms_template_without_downgrading_unicode_characters( template_id=template_id)) assert response.status_code == 200 - assert msg in response.get_data(as_text=True) + assert rendered_msg in response.get_data(as_text=True) def test_should_show_page_template_with_priority_select_if_platform_admin(