From 5277f734d9b472f04f63e6c093a3b0e0db2441a5 Mon Sep 17 00:00:00 2001 From: Katie Smith Date: Fri, 23 Jul 2021 16:56:37 +0100 Subject: [PATCH] Test the POST `.approve_broadcast_message` explicitly in the code Previously, to get the the `.approve_broadcast_message` endpoint, we were issuing a POST request to `.view_current_broadcast`. The `.view_current_broadcast` only has a GET endpoint defined for the `/services//current-alerts/` route, so the request would end up at the `.approve_broadcast_message` which defines the POST endpoint for that path. This changes the tests to POST directly to `.approve_broadcast_message` to avoid confusion. --- tests/app/main/views/test_broadcast.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/app/main/views/test_broadcast.py b/tests/app/main/views/test_broadcast.py index 83a9470d5..db095f246 100644 --- a/tests/app/main/views/test_broadcast.py +++ b/tests/app/main/views/test_broadcast.py @@ -2018,7 +2018,7 @@ def test_confirm_approve_non_training_broadcasts_errors_if_not_ticked( client_request.login(active_user_approve_broadcasts_permission) page = client_request.post( - '.view_current_broadcast', + '.approve_broadcast_message', service_id=SERVICE_ONE_ID, broadcast_message_id=fake_uuid, _data={}, @@ -2441,7 +2441,7 @@ def test_confirm_approve_broadcast( client_request.login(active_user_approve_broadcasts_permission) client_request.post( - '.view_current_broadcast', + '.approve_broadcast_message', service_id=SERVICE_ONE_ID, broadcast_message_id=fake_uuid, _expected_redirect=expected_redirect(