From 2f9e2dbc9d792fa00e7d9e13f9c538ad308eccf5 Mon Sep 17 00:00:00 2001 From: Katie Smith Date: Mon, 10 May 2021 12:35:11 +0100 Subject: [PATCH] Send api the broadcast provider restriction of 'all', not 'None' We're replacing the value of None with the value of all. API has been updated to accept both values (https://github.com/alphagov/notifications-api/pull/3233/commits/1767535defd117e1d39d3ab911f01477787eef65) so this change starts sending notifications-api the value of "all". --- app/main/forms.py | 2 +- tests/app/main/views/test_service_settings.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/main/forms.py b/app/main/forms.py index dfd7d839a..6f16fd098 100644 --- a/app/main/forms.py +++ b/app/main/forms.py @@ -2334,7 +2334,7 @@ class ServiceBroadcastAccountTypeField(GovukRadiosField): split_values = self.data.split("-") self.service_mode = split_values[0] self.broadcast_channel = split_values[1] - self.provider_restriction = split_values[2] if len(split_values) == 3 else None + self.provider_restriction = split_values[2] if len(split_values) == 3 else 'all' class ServiceBroadcastAccountTypeForm(StripWhitespaceForm): diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index 6b53a8cc2..659aab305 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -5524,9 +5524,9 @@ def test_get_service_set_broadcast_account_type_has_radio_selected_for_broadcast @pytest.mark.parametrize( 'value,service_mode,broadcast_channel,allowed_broadcast_provider', [ - ("training-test", "training", "test", None), + ("training-test", "training", "test", "all"), ("live-test-vodafone", "live", "test", "vodafone"), - ("live-severe", "live", "severe", None), + ("live-severe", "live", "severe", "all"), ] ) def test_post_service_set_broadcast_account_type_posts_data_to_api_and_redirects(