diff --git a/app/models.py b/app/models.py index ae3143b24..33fe46126 100644 --- a/app/models.py +++ b/app/models.py @@ -2178,7 +2178,10 @@ class BroadcastStatusType(db.Model): # these are only the transitions we expect to administer via the API code. ALLOWED_STATUS_TRANSITIONS = { - DRAFT: {PENDING_APPROVAL}, + DRAFT: { + PENDING_APPROVAL, + BROADCASTING, # TODO: Remove me once we have pending approval flow put in properly + }, 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 bc3caa505..dda6adf09 100644 --- a/tests/app/broadcast_message/test_rest.py +++ b/tests/app/broadcast_message/test_rest.py @@ -381,10 +381,10 @@ def test_update_broadcast_message_status_rejects_approval_from_user_not_on_that_ @pytest.mark.parametrize('current_status, new_status', [ (BroadcastStatusType.DRAFT, BroadcastStatusType.DRAFT), - (BroadcastStatusType.DRAFT, BroadcastStatusType.BROADCASTING), (BroadcastStatusType.BROADCASTING, BroadcastStatusType.PENDING_APPROVAL), (BroadcastStatusType.COMPLETED, BroadcastStatusType.BROADCASTING), (BroadcastStatusType.CANCELLED, BroadcastStatusType.DRAFT), + pytest.param(BroadcastStatusType.DRAFT, BroadcastStatusType.BROADCASTING, marks=pytest.mark.xfail()), ]) def test_update_broadcast_message_status_restricts_status_transitions_to_explicit_list( admin_request,