mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 02:11:11 -05:00
Use NOTIFICATION_TECHNICAL_FAILURE not NOTIFICATION_FAILED
This commit is contained in:
@@ -47,7 +47,7 @@ from app.dao.templates_dao import dao_get_template_by_id
|
|||||||
from app.models import (
|
from app.models import (
|
||||||
Job,
|
Job,
|
||||||
Notification,
|
Notification,
|
||||||
DVLA_STATUS_SENT,
|
DVLA_RESPONSE_STATUS_SENT,
|
||||||
EMAIL_TYPE,
|
EMAIL_TYPE,
|
||||||
JOB_STATUS_CANCELLED,
|
JOB_STATUS_CANCELLED,
|
||||||
JOB_STATUS_FINISHED,
|
JOB_STATUS_FINISHED,
|
||||||
@@ -58,7 +58,6 @@ from app.models import (
|
|||||||
KEY_TYPE_NORMAL,
|
KEY_TYPE_NORMAL,
|
||||||
LETTER_TYPE,
|
LETTER_TYPE,
|
||||||
NOTIFICATION_DELIVERED,
|
NOTIFICATION_DELIVERED,
|
||||||
NOTIFICATION_FAILED,
|
|
||||||
NOTIFICATION_SENDING,
|
NOTIFICATION_SENDING,
|
||||||
NOTIFICATION_TECHNICAL_FAILURE,
|
NOTIFICATION_TECHNICAL_FAILURE,
|
||||||
SMS_TYPE,
|
SMS_TYPE,
|
||||||
@@ -447,7 +446,8 @@ def update_letter_notifications_statuses(self, filename):
|
|||||||
raise
|
raise
|
||||||
else:
|
else:
|
||||||
for update in notification_updates:
|
for update in notification_updates:
|
||||||
status = NOTIFICATION_DELIVERED if update.status == DVLA_STATUS_SENT else NOTIFICATION_FAILED
|
status = NOTIFICATION_DELIVERED if update.status == DVLA_RESPONSE_STATUS_SENT \
|
||||||
|
else NOTIFICATION_TECHNICAL_FAILURE
|
||||||
notification = update_notification_status_by_reference(
|
notification = update_notification_status_by_reference(
|
||||||
update.reference,
|
update.reference,
|
||||||
status
|
status
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ from app.models import (
|
|||||||
Notification,
|
Notification,
|
||||||
NOTIFICATION_CREATED,
|
NOTIFICATION_CREATED,
|
||||||
NOTIFICATION_DELIVERED,
|
NOTIFICATION_DELIVERED,
|
||||||
NOTIFICATION_FAILED,
|
NOTIFICATION_TECHNICAL_FAILURE,
|
||||||
NOTIFICATION_SENDING,
|
NOTIFICATION_SENDING,
|
||||||
NOTIFICATION_STATUS_LETTER_RECEIVED,
|
NOTIFICATION_STATUS_LETTER_RECEIVED,
|
||||||
NOTIFICATION_TECHNICAL_FAILURE
|
NOTIFICATION_TECHNICAL_FAILURE
|
||||||
@@ -106,7 +106,7 @@ def test_update_letter_notifications_statuses_persisted(notify_api, mocker, samp
|
|||||||
update_letter_notifications_statuses(filename='foo.txt')
|
update_letter_notifications_statuses(filename='foo.txt')
|
||||||
|
|
||||||
assert sent_letter.status == NOTIFICATION_DELIVERED
|
assert sent_letter.status == NOTIFICATION_DELIVERED
|
||||||
assert failed_letter.status == NOTIFICATION_FAILED
|
assert failed_letter.status == NOTIFICATION_TECHNICAL_FAILURE
|
||||||
|
|
||||||
|
|
||||||
def test_update_letter_notifications_to_sent_to_dvla_updates_based_on_notification_references(
|
def test_update_letter_notifications_to_sent_to_dvla_updates_based_on_notification_references(
|
||||||
|
|||||||
Reference in New Issue
Block a user