From 36b95a740ed1e1ad5af6a2faa021188f300dacd6 Mon Sep 17 00:00:00 2001 From: Leo Hemsted Date: Thu, 23 Nov 2017 15:08:11 +0000 Subject: [PATCH] update utils to 23.1.0 - to show alphanumeric inbound messages on the frontend --- requirements.txt | 2 +- tests/app/main/views/test_conversation.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index fa0a5d53f..be92af02e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -21,4 +21,4 @@ notifications-python-client==4.6.0 awscli>=1.11,<1.12 awscli-cwlogs>=1.4,<1.5 -git+https://github.com/alphagov/notifications-utils.git@23.0.1#egg=notifications-utils==23.0.1 +git+https://github.com/alphagov/notifications-utils.git@23.1.0#egg=notifications-utils==23.1.0 diff --git a/tests/app/main/views/test_conversation.py b/tests/app/main/views/test_conversation.py index dba58a14c..f03adc771 100644 --- a/tests/app/main/views/test_conversation.py +++ b/tests/app/main/views/test_conversation.py @@ -286,3 +286,18 @@ def test_conversation_reply_redirects_with_phone_number_from_notification( ('.sms-message-wrapper', 'service one: Template content with & entity'), ]: assert normalize_spaces(page.select_one(element).text) == expected_text + + +def test_get_user_phone_number_when_not_a_standard_phone_number(mocker): + mocker.patch( + 'app.main.views.conversation.service_api_client.get_inbound_sms_by_id', + return_value={ + 'user_number': 'ALPHANUM3R1C', + 'notify_number': '07900000002' + } + ) + mocker.patch( + 'app.main.views.conversation.notification_api_client.get_notification', + side_effect=HTTPError, + ) + assert get_user_number('service', 'notification') == 'ALPHANUM3R1C'