Simplify network choice to optional radio buttons

Previously this field had to mimic the final hyphenated string of
the broadcast account type, even though it was only used to select
one of its components. The new, shorter choices make it easier to
simplify the test for the POST request.

I've also deleted a number of test cases for pre-selected radios.
This functionality isn't critical, so we don't need to exhaustively
test every single possible combination of values.
This commit is contained in:
Ben Thorner
2021-06-07 17:06:15 +01:00
parent ef8cab7fa4
commit b38cdcad63
3 changed files with 33 additions and 112 deletions

View File

@@ -355,21 +355,11 @@ def service_set_broadcast_network(service_id, broadcast_channel):
if current_service.broadcast_channel == broadcast_channel:
provider = current_service.allowed_broadcast_provider
if provider == 'all':
form = ServiceBroadcastNetworkForm(
broadcast_channel=broadcast_channel,
all_networks=True,
)
else:
form = ServiceBroadcastNetworkForm(
broadcast_channel=broadcast_channel,
all_networks=False,
network=(
current_service.live,
current_service.broadcast_channel,
provider,
)
)
form = ServiceBroadcastNetworkForm(
broadcast_channel=broadcast_channel,
all_networks=provider == 'all',
network=provider if provider != 'all' else None,
)
else:
form = ServiceBroadcastNetworkForm(
broadcast_channel=broadcast_channel