Added a cancelled notification status so that we can cancel letters before they are sent.

This commit is contained in:
Rebecca Law
2018-07-31 13:52:04 +01:00
parent ff2334937c
commit 19890412c9
2 changed files with 4 additions and 2 deletions

View File

@@ -1034,6 +1034,7 @@ class VerifyCode(db.Model):
return check_hash(cde, self._code)
NOTIFICATION_CANCELLED = 'cancelled'
NOTIFICATION_CREATED = 'created'
NOTIFICATION_SENDING = 'sending'
NOTIFICATION_SENT = 'sent'
@@ -1077,6 +1078,7 @@ NOTIFICATION_STATUS_TYPES_BILLABLE = [
]
NOTIFICATION_STATUS_TYPES = [
NOTIFICATION_CANCELLED,
NOTIFICATION_CREATED,
NOTIFICATION_SENDING,
NOTIFICATION_SENT,

View File

@@ -42,7 +42,7 @@ def test_get_notifications_request_invalid_statuses(
invalid_statuses, valid_statuses
):
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, " \
"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]
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-virus-check, virus-scan-failed, accepted, received]".format(
invalid_status