mirror of
https://github.com/GSA/notifications-api.git
synced 2026-04-20 17:29:54 -04:00
rename received_by_notify to accepted
accepted is nice since it both implies that things look good, while not being commital about next steps.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user