diff --git a/app/models.py b/app/models.py index 3001e286d..e1a9f36fd 100644 --- a/app/models.py +++ b/app/models.py @@ -797,8 +797,8 @@ NOTIFICATION_STATUS_TYPES_NON_BILLABLE = list(set(NOTIFICATION_STATUS_TYPES) - s NOTIFICATION_STATUS_TYPES_ENUM = db.Enum(*NOTIFICATION_STATUS_TYPES, name='notify_status_type') -NOTIFICATION_STATUS_LETTER_RECEIVED = 'received_by_notify' -NOTIFICATION_STATUS_LETTER_RECEIVED_PRETTY = 'Received by Notify' +NOTIFICATION_STATUS_LETTER_ACCEPTED = 'accepted' +NOTIFICATION_STATUS_LETTER_ACCEPTED_PRETTY = 'Accepted' class NotificationStatusTypes(db.Model): @@ -966,8 +966,8 @@ class Notification(db.Model): }, 'letter': { 'technical-failure': 'Technical failure', - 'sending': NOTIFICATION_STATUS_LETTER_RECEIVED_PRETTY, - 'created': NOTIFICATION_STATUS_LETTER_RECEIVED_PRETTY, + 'sending': NOTIFICATION_STATUS_LETTER_ACCEPTED_PRETTY, + 'created': NOTIFICATION_STATUS_LETTER_ACCEPTED_PRETTY, } }[self.template.template_type].get(self.status, self.status) @@ -983,7 +983,7 @@ class Notification(db.Model): assert self.notification_type == LETTER_TYPE if self.status == NOTIFICATION_CREATED or NOTIFICATION_SENDING: - return NOTIFICATION_STATUS_LETTER_RECEIVED + return NOTIFICATION_STATUS_LETTER_ACCEPTED else: # Currently can only be technical-failure return status diff --git a/tests/app/test_model.py b/tests/app/test_model.py index e1496163d..0dd18eb56 100644 --- a/tests/app/test_model.py +++ b/tests/app/test_model.py @@ -116,8 +116,8 @@ def test_notification_for_csv_returns_correct_job_row_number(notify_db, notify_d ('sms', 'temporary-failure', 'Phone not accepting messages right now'), ('sms', 'permanent-failure', 'Phone number doesn’t exist'), ('sms', 'sent', 'Sent internationally'), - ('letter', 'created', 'Received by Notify'), - ('letter', 'sending', 'Received by Notify'), + ('letter', 'created', 'Accepted'), + ('letter', 'sending', 'Accepted'), ('letter', 'technical-failure', 'Technical failure') ]) def test_notification_for_csv_returns_formatted_status( diff --git a/tests/app/v2/notifications/test_get_notifications.py b/tests/app/v2/notifications/test_get_notifications.py index 626c01432..651de4253 100644 --- a/tests/app/v2/notifications/test_get_notifications.py +++ b/tests/app/v2/notifications/test_get_notifications.py @@ -573,7 +573,7 @@ def test_get_all_notifications_renames_letter_statuses(client, sample_letter_not if noti['type'] == 'sms': assert noti['status'] == 'created' elif noti['type'] == 'letter': - assert noti['status'] == 'received_by_notify' + assert noti['status'] == 'accepted' else: pytest.fail() @@ -588,4 +588,4 @@ def test_get_notifications_renames_letter_statuses(client, sample_letter_notific json_response = json.loads(response.get_data(as_text=True)) assert response.status_code == 200 - assert json_response['status'] == 'received_by_notify' + assert json_response['status'] == 'accepted'