Skip to content

Commit

Permalink
remove old data keys from go-live requests. And tests
Browse files Browse the repository at this point in the history
  • Loading branch information
amazingphilippe committed Dec 17, 2024
1 parent 4846698 commit c97056b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
9 changes: 6 additions & 3 deletions app/main/views/service_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
16 changes: 12 additions & 4 deletions tests/app/main/views/test_service_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand All @@ -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",
Expand All @@ -1265,7 +1268,12 @@ def test_submit_go_live_request(
"intended_recipients": "public",
"main_use_case": "Purpose",
"email_address": "[email protected]",
"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)
Expand Down

0 comments on commit c97056b

Please sign in to comment.