From c97056baba54951c65237857852c4c3a5d821185 Mon Sep 17 00:00:00 2001 From: Philippe Caron Date: Tue, 17 Dec 2024 19:24:12 +0000 Subject: [PATCH] remove old data keys from go-live requests. And tests --- app/main/views/service_settings.py | 9 ++++++--- tests/app/main/views/test_service_settings.py | 16 ++++++++++++---- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/app/main/views/service_settings.py b/app/main/views/service_settings.py index 677344fb9..d5065969d 100644 --- a/app/main/views/service_settings.py +++ b/app/main/views/service_settings.py @@ -345,13 +345,16 @@ def send_go_live_request(service, user, go_live_data) -> None: "department_org_name", "intended_recipients", "main_use_case", - "notification_types", - "expected_volume", "support_type", + "daily_email_volume", + "annual_email_volume", + "daily_sms_volume", + "annual_sms_volume", + "how_many_more_email", + "how_many_more_sms", } data = {key: go_live_data[key] for key in of_interest if key in go_live_data} data["intended_recipients"] = ", ".join(data["intended_recipients"]) - data["notification_types"] = ", ".join(data["notification_types"]) user_api_client.send_contact_request(data) diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index c161864fb..5c68170aa 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -1235,8 +1235,12 @@ def test_submit_go_live_request( "department_org_name": "Org name", "intended_recipients": ["public"], "purpose": "Purpose", - "expected_volume": "1-10k", - "notification_types": ["email"], + "daily_email_volume": "0", + "annual_email_volume": "within_limit", + "daily_sms_volume": "more_sms", + "annual_sms_volume": "above_limit", + "how_many_more_email": None, + "how_many_more_sms": 25000, }, "step": "about-notifications", }, @@ -1256,7 +1260,6 @@ def test_submit_go_live_request( expected_data = { "name": "Test User", - "expected_volume": "1-10k", "department_org_name": "Org name", "service_url": f"http://localhost/services/{SERVICE_ONE_ID}", "support_type": "go_live_request", @@ -1265,7 +1268,12 @@ def test_submit_go_live_request( "intended_recipients": "public", "main_use_case": "Purpose", "email_address": "test@user.canada.ca", - "notification_types": "email", + "daily_email_volume": "0", + "annual_email_volume": "within_limit", + "daily_sms_volume": "more_sms", + "annual_sms_volume": "above_limit", + "how_many_more_email": None, + "how_many_more_sms": 25000, } mock_contact.assert_called_once_with(expected_data)