Allow provider_restriction to be None or "all"

Until all the data is updated to always be "all", we have to handle the
case of provider_restriction being set to None or "all" (which mean the
same thing).

The code can be tidied up once the broadcast provider_restriction is never None.
This commit is contained in:
Katie Smith
2021-05-10 14:35:18 +01:00
parent 2f9e2dbc9d
commit 3485475270
6 changed files with 37 additions and 4 deletions

View File

@@ -301,6 +301,20 @@ def test_broadcast_tour_page_4_shows_service_name(
'service one Live Switch service',
'Live',
),
(
True,
"all",
'.navigation-service-type.navigation-service-type--training',
'service one Training Switch service',
'Training',
),
(
False,
"all",
'.navigation-service-type.navigation-service-type--live',
'service one Live Switch service',
'Live',
),
(
True,

View File

@@ -199,12 +199,17 @@ def test_platform_admin_sees_only_relevant_settings_for_broadcast_service(
'has_broadcast_permission,service_mode,broadcast_channel,allowed_broadcast_provider,expected_text',
[
(False, "training", None, None, "Off"),
(False, "training", None, "all", "Off"),
(False, "live", None, None, "Off"),
(False, "live", None, "all", "Off"),
(True, "training", "test", None, "Training"),
(True, "training", "test", "all", "Training"),
(True, "live", "test", "ee", "Test (EE)"),
(True, "live", "test", "three", "Test (Three)"),
(True, "live", "test", None, "Test (All networks)"),
(True, "live", "test", "all", "Test (All networks)"),
(True, "live", "severe", None, "Live"),
(True, "live", "severe", "all", "Live"),
]
)
def test_platform_admin_sees_correct_description_of_broadcast_service_setting(
@@ -5470,6 +5475,13 @@ def test_get_service_set_broadcast_account_type_has_no_radio_selected_for_non_br
"Training mode",
"training-test",
),
(
"training",
"test",
"all",
"Training mode",
"training-test",
),
(
"live",
"test",
@@ -5484,6 +5496,13 @@ def test_get_service_set_broadcast_account_type_has_no_radio_selected_for_non_br
"Live (all networks)",
"live-severe",
),
(
"live",
"severe",
"all",
"Live (all networks)",
"live-severe",
),
]
)
def test_get_service_set_broadcast_account_type_has_radio_selected_for_broadcast_service(