diff --git a/app/models.py b/app/models.py index 7d3e1b7b8..8e59c01ca 100644 --- a/app/models.py +++ b/app/models.py @@ -2218,10 +2218,7 @@ class BroadcastStatusType(db.Model): # these are only the transitions we expect to administer via the API code. ALLOWED_STATUS_TRANSITIONS = { - DRAFT: { - PENDING_APPROVAL, - BROADCASTING, # TODO: Remove me once we have pending approval flow put in properly - }, + DRAFT: {PENDING_APPROVAL}, PENDING_APPROVAL: {REJECTED, DRAFT, BROADCASTING}, REJECTED: {DRAFT, PENDING_APPROVAL}, BROADCASTING: {COMPLETED, CANCELLED}, diff --git a/tests/app/broadcast_message/test_rest.py b/tests/app/broadcast_message/test_rest.py index 8e8802a2a..77185ba48 100644 --- a/tests/app/broadcast_message/test_rest.py +++ b/tests/app/broadcast_message/test_rest.py @@ -807,7 +807,7 @@ def test_update_broadcast_message_status_rejects_approval_from_user_not_on_that_ (BroadcastStatusType.BROADCASTING, BroadcastStatusType.PENDING_APPROVAL), (BroadcastStatusType.COMPLETED, BroadcastStatusType.BROADCASTING), (BroadcastStatusType.CANCELLED, BroadcastStatusType.DRAFT), - pytest.param(BroadcastStatusType.DRAFT, BroadcastStatusType.BROADCASTING, marks=pytest.mark.xfail()), + (BroadcastStatusType.DRAFT, BroadcastStatusType.BROADCASTING), ]) def test_update_broadcast_message_status_restricts_status_transitions_to_explicit_list( admin_request,