mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05:00
Only send to the provider if the notification has a created status.
If the notification ends up in the retry queue and the delivery app is restarted the notification will get sent twice. This is because when the app is restarted another message will be in the retry queue as message available which is a duplicate of the one in the queue that is a message in flight. This should complete https://www.pivotaltracker.com/story/show/121844427
This commit is contained in:
@@ -116,7 +116,8 @@ def test_send_sms_should_use_template_version_from_notification_not_latest(
|
||||
sample_template,
|
||||
mocker):
|
||||
db_notification = sample_notification(notify_db, notify_db_session,
|
||||
template=sample_template, to_field='+447234123123')
|
||||
template=sample_template, to_field='+447234123123',
|
||||
status='created')
|
||||
|
||||
mocker.patch('app.mmg_client.send_sms')
|
||||
mocker.patch('app.mmg_client.get_name', return_value="mmg")
|
||||
@@ -146,6 +147,7 @@ def test_send_sms_should_use_template_version_from_notification_not_latest(
|
||||
assert persisted_notification.template_version == version_on_notification
|
||||
assert persisted_notification.template_version != sample_template.version
|
||||
assert persisted_notification.content_char_count == len("Sample service: This is a template")
|
||||
assert persisted_notification.status == 'sending'
|
||||
assert not persisted_notification.personalisation
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user