mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 05:59:44 -04:00
Expire test and operator alerts after 4 hours
While testing alerts on these channels the MNOs sometimes need to restart their CBCs to make sure everything is failing over properly. If the CBC does not come back up, for whatever reason, then we are left in a state where the alert can’t be cancelled. To minimise the impact to the public in this scenario we should keep the expiry time at 4 hours for alerts sent on test channels. We recently increased it back up to 24 hours for all channels, so this in effect is reverting that change for channels that won’t be used in a real emergency.
This commit is contained in:
@@ -2375,6 +2375,16 @@ def test_user_without_approve_permission_cant_approve_broadcast_they_created(
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('channel, expected_finishes_at', (
|
||||
# 4 hours later
|
||||
('operator', '2020-02-23T02:22:22'),
|
||||
('test', '2020-02-23T02:22:22'),
|
||||
|
||||
# 23 hours 59 minutes later
|
||||
('severe', '2020-02-23T22:21:22'),
|
||||
('government', '2020-02-23T22:21:22'),
|
||||
(None, '2020-02-23T22:21:22'), # Training mode
|
||||
))
|
||||
@pytest.mark.parametrize(
|
||||
'trial_mode, initial_status, post_data, expected_approval, expected_redirect',
|
||||
(
|
||||
@@ -2424,6 +2434,8 @@ def test_confirm_approve_broadcast(
|
||||
expected_approval,
|
||||
trial_mode,
|
||||
expected_redirect,
|
||||
channel,
|
||||
expected_finishes_at,
|
||||
):
|
||||
mocker.patch(
|
||||
'app.broadcast_message_api_client.get_broadcast_message',
|
||||
@@ -2438,6 +2450,7 @@ def test_confirm_approve_broadcast(
|
||||
)
|
||||
service_one['restricted'] = trial_mode
|
||||
service_one['permissions'] += ['broadcast']
|
||||
service_one['broadcast_channel'] = channel
|
||||
|
||||
client_request.login(active_user_approve_broadcasts_permission)
|
||||
client_request.post(
|
||||
@@ -2457,7 +2470,7 @@ def test_confirm_approve_broadcast(
|
||||
broadcast_message_id=fake_uuid,
|
||||
data={
|
||||
'starts_at': '2020-02-22T22:22:22',
|
||||
'finishes_at': '2020-02-23T22:21:22',
|
||||
'finishes_at': expected_finishes_at,
|
||||
},
|
||||
)
|
||||
mock_update_broadcast_message_status.assert_called_once_with(
|
||||
|
||||
Reference in New Issue
Block a user