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/<uuid:service_id>/current-alerts/<uuid:broadcast_message_id>`
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.
This commit is contained in:
Katie Smith
2021-07-23 16:56:37 +01:00
parent a7a1172e22
commit 5277f734d9

View File

@@ -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(