From 21d29a30904088bcf1cee310eef0f972d7228a34 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Mon, 24 Sep 2018 17:47:56 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20missing=20=E2=80=98complete=E2=80=99=20ta?= =?UTF-8?q?g=20in=20go=20live=20request?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This tag was not showing up in the call to the Zendesk API because the return value of a generator is not included as a member of that generator (on things `yield`ed from it are). --- app/main/views/service_settings.py | 7 +++---- tests/app/main/views/test_service_settings.py | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/main/views/service_settings.py b/app/main/views/service_settings.py index 58b84b442..bb6297dab 100644 --- a/app/main/views/service_settings.py +++ b/app/main/views/service_settings.py @@ -1120,13 +1120,12 @@ def get_request_to_go_live_tags(service, user): def _get_request_to_go_live_tags(service, agreement_signed): BASE = 'notify_request_to_go_live' - COMPLETE = BASE + '_complete' - INCOMPLETE = BASE + '_incomplete' yield BASE if service.go_live_checklist_completed and agreement_signed: - return COMPLETE + yield BASE + '_complete' + return for test, tag in ( (True, ''), @@ -1138,4 +1137,4 @@ def _get_request_to_go_live_tags(service, agreement_signed): (service.needs_to_change_sms_sender, '_sms_sender'), ): if test: - yield INCOMPLETE + tag + yield BASE + '_incomplete' + tag diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index 9052439ce..263d42eda 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -818,6 +818,7 @@ def test_should_redirect_after_request_to_go_live( True, [ 'notify_request_to_go_live', + 'notify_request_to_go_live_complete', ], ), ( # Needs to set reply to address @@ -849,6 +850,7 @@ def test_should_redirect_after_request_to_go_live( True, [ 'notify_request_to_go_live', + 'notify_request_to_go_live_complete', ], ), ( # Needs to change SMS sender