mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-21 16:01:15 -05:00
Added a cancelled notification status so that we can cancel letters before they are sent.
This commit is contained in:
@@ -1034,6 +1034,7 @@ class VerifyCode(db.Model):
|
|||||||
return check_hash(cde, self._code)
|
return check_hash(cde, self._code)
|
||||||
|
|
||||||
|
|
||||||
|
NOTIFICATION_CANCELLED = 'cancelled'
|
||||||
NOTIFICATION_CREATED = 'created'
|
NOTIFICATION_CREATED = 'created'
|
||||||
NOTIFICATION_SENDING = 'sending'
|
NOTIFICATION_SENDING = 'sending'
|
||||||
NOTIFICATION_SENT = 'sent'
|
NOTIFICATION_SENT = 'sent'
|
||||||
@@ -1077,6 +1078,7 @@ NOTIFICATION_STATUS_TYPES_BILLABLE = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
NOTIFICATION_STATUS_TYPES = [
|
NOTIFICATION_STATUS_TYPES = [
|
||||||
|
NOTIFICATION_CANCELLED,
|
||||||
NOTIFICATION_CREATED,
|
NOTIFICATION_CREATED,
|
||||||
NOTIFICATION_SENDING,
|
NOTIFICATION_SENDING,
|
||||||
NOTIFICATION_SENT,
|
NOTIFICATION_SENT,
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ def test_get_notifications_request_invalid_statuses(
|
|||||||
invalid_statuses, valid_statuses
|
invalid_statuses, valid_statuses
|
||||||
):
|
):
|
||||||
partial_error_status = "is not one of " \
|
partial_error_status = "is not one of " \
|
||||||
"[created, sending, sent, delivered, pending, failed, " \
|
"[cancelled, created, sending, sent, delivered, pending, failed, " \
|
||||||
"technical-failure, temporary-failure, permanent-failure, pending-virus-check, " \
|
"technical-failure, temporary-failure, permanent-failure, pending-virus-check, " \
|
||||||
"virus-scan-failed, accepted, received]"
|
"virus-scan-failed, accepted, received]"
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ def test_get_notifications_request_invalid_statuses_and_template_types():
|
|||||||
|
|
||||||
error_messages = [error['message'] for error in errors]
|
error_messages = [error['message'] for error in errors]
|
||||||
for invalid_status in ["elephant", "giraffe"]:
|
for invalid_status in ["elephant", "giraffe"]:
|
||||||
assert "status {} is not one of [created, sending, sent, delivered, " \
|
assert "status {} is not one of [cancelled, created, sending, sent, delivered, " \
|
||||||
"pending, failed, technical-failure, temporary-failure, permanent-failure, " \
|
"pending, failed, technical-failure, temporary-failure, permanent-failure, " \
|
||||||
"pending-virus-check, virus-scan-failed, accepted, received]".format(
|
"pending-virus-check, virus-scan-failed, accepted, received]".format(
|
||||||
invalid_status
|
invalid_status
|
||||||
|
|||||||
Reference in New Issue
Block a user