mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-20 14:29:25 -04:00
Add notification status for returned letters
We need to update letter notifications with a new status when DVLA gives us a list of references for returned letters. This adds the new status to the models and the DB. DVLA call this 'returned mail', so I'm using it as the status name since it seems less ambiguous than 'returned'.
This commit is contained in:
@@ -1683,6 +1683,18 @@ def test_dao_update_notifications_by_reference_returns_zero_when_no_notification
|
||||
assert updated_count == 0
|
||||
|
||||
|
||||
def test_dao_update_notifications_by_reference_set_returned_letter_status(sample_letter_template):
|
||||
notification = create_notification(template=sample_letter_template, reference='ref')
|
||||
|
||||
updated_count = dao_update_notifications_by_reference(
|
||||
references=['ref'],
|
||||
update_dict={"status": "returned-letter"}
|
||||
)
|
||||
|
||||
assert updated_count == 1
|
||||
assert Notification.query.get(notification.id).status == 'returned-letter'
|
||||
|
||||
|
||||
def test_dao_get_notification_by_reference_with_one_match_returns_notification(sample_letter_template, notify_db):
|
||||
create_notification(template=sample_letter_template, reference='REF1')
|
||||
notification = dao_get_notification_by_reference('REF1')
|
||||
|
||||
Reference in New Issue
Block a user