From be035664c42c9c026beb3277f20a7935074bfb98 Mon Sep 17 00:00:00 2001 From: David McDonald Date: Wed, 9 Jun 2021 13:49:06 +0100 Subject: [PATCH] Add operator channel to broadcast settings route Looks identical to the government channel in terms of the interface --- app/service/service_broadcast_settings_schema.py | 2 +- tests/app/celery/test_broadcast_message_tasks.py | 2 +- tests/app/service/test_rest.py | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/service/service_broadcast_settings_schema.py b/app/service/service_broadcast_settings_schema.py index cc98a718f..42b0df81d 100644 --- a/app/service/service_broadcast_settings_schema.py +++ b/app/service/service_broadcast_settings_schema.py @@ -4,7 +4,7 @@ service_broadcast_settings_schema = { "type": "object", "title": "Set a services broadcast settings", "properties": { - "broadcast_channel": {"enum": ["test", "severe", "government"]}, + "broadcast_channel": {"enum": ["operator", "test", "severe", "government"]}, "service_mode": {"enum": ["training", "live"]}, "provider_restriction": {"enum": ["three", "o2", "vodafone", "ee", "all"]} }, diff --git a/tests/app/celery/test_broadcast_message_tasks.py b/tests/app/celery/test_broadcast_message_tasks.py index eca8b2ce2..cb6da59fb 100644 --- a/tests/app/celery/test_broadcast_message_tasks.py +++ b/tests/app/celery/test_broadcast_message_tasks.py @@ -221,7 +221,7 @@ def test_send_broadcast_provider_message_sends_data_correctly( ['o2', 'O2'], ['vodafone', 'Vodafone'], ]) -@pytest.mark.parametrize('channel', ['test', 'severe', 'government']) +@pytest.mark.parametrize('channel', ['operator', 'test', 'severe', 'government']) def test_send_broadcast_provider_message_uses_channel_set_on_broadcast_service( notify_db, mocker, sample_broadcast_service, provider, provider_capitalised, channel ): diff --git a/tests/app/service/test_rest.py b/tests/app/service/test_rest.py index c6d666a2d..5c2553fb4 100644 --- a/tests/app/service/test_rest.py +++ b/tests/app/service/test_rest.py @@ -290,9 +290,11 @@ def test_get_service_by_id(admin_request, sample_service): @pytest.mark.parametrize('broadcast_channel,allowed_broadcast_provider', ( + ('operator', 'all'), ('test', 'all'), ('severe', 'all'), ('government', 'all'), + ('operator', 'o2'), ('test', 'ee'), ('severe', 'three'), ('government', 'vodafone'), @@ -3711,7 +3713,7 @@ def test_get_returned_letter(admin_request, sample_letter_template): assert response[4]['uploaded_letter_file_name'] == 'filename.pdf' -@pytest.mark.parametrize('channel', ["test", "severe", "government"]) +@pytest.mark.parametrize('channel', ["operator", "test", "severe", "government"]) def test_set_as_broadcast_service_sets_broadcast_channel( admin_request, sample_service, broadcast_organisation, channel ):