mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
Don't update sent notifications (dao)
This commit is contained in:
@@ -15,6 +15,7 @@ from app.models import (
|
||||
TemplateStatistics,
|
||||
NOTIFICATION_STATUS_TYPES,
|
||||
NOTIFICATION_STATUS_TYPES_FAILED,
|
||||
NOTIFICATION_SENT,
|
||||
KEY_TYPE_NORMAL,
|
||||
KEY_TYPE_TEAM,
|
||||
KEY_TYPE_TEST
|
||||
@@ -353,11 +354,27 @@ def test_should_update_status_by_id_if_created(notify_db, notify_db_session):
|
||||
|
||||
|
||||
def test_should_not_update_status_by_reference_if_in_sent_status(notify_db, notify_db_session):
|
||||
assert 1 == 2
|
||||
notification = sample_notification(
|
||||
notify_db,
|
||||
notify_db_session,
|
||||
status=NOTIFICATION_SENT,
|
||||
reference='foo'
|
||||
)
|
||||
|
||||
update_notification_status_by_reference('foo', 'failed')
|
||||
assert Notification.query.get(notification.id).status == NOTIFICATION_SENT
|
||||
|
||||
|
||||
def test_should_not_update_status_by_id_if_in_sent_status(notify_db, notify_db_session):
|
||||
assert 1 == 2
|
||||
notification = sample_notification(
|
||||
notify_db,
|
||||
notify_db_session,
|
||||
status=NOTIFICATION_SENT
|
||||
)
|
||||
|
||||
update_notification_status_by_id(notification.id, 'failed')
|
||||
|
||||
assert Notification.query.get(notification.id).status == NOTIFICATION_SENT
|
||||
|
||||
|
||||
def test_should_not_update_status_by_reference_if_not_sending(notify_db, notify_db_session):
|
||||
|
||||
Reference in New Issue
Block a user