From 531219b87e308568f0eb61844f33b52f12310a1d Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 1 Mar 2019 15:10:51 +0000 Subject: [PATCH] Make SMS sender dependent on estimated SMS volumes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We have a number of go live requests where people have said they’re sending text messages, but haven’t changed the text message sender from the default of `GOVUK` (we ask teams who aren’t central government to do this). At the moment we don’t prompt them to, because we look at whether they have text message templates as indicative of whether they’re going to send text messages. Now that we explicitly ask for the volumes of text messages they’re sending we should use this to determine whether or not we prompt them to change their text message sender because it’s a stronger signal of intent than what templates they’ve set up. --- app/models/service.py | 2 +- tests/app/main/views/test_service_settings.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/models/service.py b/app/models/service.py index 52ed19f90..c789dca8b 100644 --- a/app/models/service.py +++ b/app/models/service.py @@ -269,7 +269,7 @@ class Service(): @property def needs_to_change_sms_sender(self): return all(( - self.has_sms_templates, + self.volume_sms, self.shouldnt_use_govuk_as_sms_sender, self.sms_sender_is_govuk, )) diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index e58d7b9ac..747a8b884 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -1176,7 +1176,7 @@ def test_should_redirect_after_request_to_go_live( False, True, True, - 1, 1, 1, + 1, 0, 1, 'No', True, [ @@ -1228,7 +1228,7 @@ def test_should_redirect_after_request_to_go_live( True, True, False, - 1, 1, 1, + 1, 0, 0, 'No', True, [ @@ -1275,7 +1275,6 @@ def test_should_redirect_after_request_to_go_live( 'notify_request_to_go_live_incomplete_mou', 'notify_request_to_go_live_incomplete_team_member', 'notify_request_to_go_live_incomplete_template_content', - 'notify_request_to_go_live_incomplete_sms_sender', ], ), ),