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:
Leo Hemsted
2017-09-11 11:57:33 +01:00
parent 18639354fa
commit cb3379d0b6
3 changed files with 9 additions and 9 deletions

View File

@@ -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_TYPES_ENUM = db.Enum(*NOTIFICATION_STATUS_TYPES, name='notify_status_type')
NOTIFICATION_STATUS_LETTER_RECEIVED = 'received_by_notify' NOTIFICATION_STATUS_LETTER_ACCEPTED = 'accepted'
NOTIFICATION_STATUS_LETTER_RECEIVED_PRETTY = 'Received by Notify' NOTIFICATION_STATUS_LETTER_ACCEPTED_PRETTY = 'Accepted'
class NotificationStatusTypes(db.Model): class NotificationStatusTypes(db.Model):
@@ -966,8 +966,8 @@ class Notification(db.Model):
}, },
'letter': { 'letter': {
'technical-failure': 'Technical failure', 'technical-failure': 'Technical failure',
'sending': NOTIFICATION_STATUS_LETTER_RECEIVED_PRETTY, 'sending': NOTIFICATION_STATUS_LETTER_ACCEPTED_PRETTY,
'created': NOTIFICATION_STATUS_LETTER_RECEIVED_PRETTY, 'created': NOTIFICATION_STATUS_LETTER_ACCEPTED_PRETTY,
} }
}[self.template.template_type].get(self.status, self.status) }[self.template.template_type].get(self.status, self.status)
@@ -983,7 +983,7 @@ class Notification(db.Model):
assert self.notification_type == LETTER_TYPE assert self.notification_type == LETTER_TYPE
if self.status == NOTIFICATION_CREATED or NOTIFICATION_SENDING: if self.status == NOTIFICATION_CREATED or NOTIFICATION_SENDING:
return NOTIFICATION_STATUS_LETTER_RECEIVED return NOTIFICATION_STATUS_LETTER_ACCEPTED
else: else:
# Currently can only be technical-failure # Currently can only be technical-failure
return status return status

View File

@@ -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', 'temporary-failure', 'Phone not accepting messages right now'),
('sms', 'permanent-failure', 'Phone number doesnt exist'), ('sms', 'permanent-failure', 'Phone number doesnt exist'),
('sms', 'sent', 'Sent internationally'), ('sms', 'sent', 'Sent internationally'),
('letter', 'created', 'Received by Notify'), ('letter', 'created', 'Accepted'),
('letter', 'sending', 'Received by Notify'), ('letter', 'sending', 'Accepted'),
('letter', 'technical-failure', 'Technical failure') ('letter', 'technical-failure', 'Technical failure')
]) ])
def test_notification_for_csv_returns_formatted_status( def test_notification_for_csv_returns_formatted_status(

View File

@@ -573,7 +573,7 @@ def test_get_all_notifications_renames_letter_statuses(client, sample_letter_not
if noti['type'] == 'sms': if noti['type'] == 'sms':
assert noti['status'] == 'created' assert noti['status'] == 'created'
elif noti['type'] == 'letter': elif noti['type'] == 'letter':
assert noti['status'] == 'received_by_notify' assert noti['status'] == 'accepted'
else: else:
pytest.fail() 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)) json_response = json.loads(response.get_data(as_text=True))
assert response.status_code == 200 assert response.status_code == 200
assert json_response['status'] == 'received_by_notify' assert json_response['status'] == 'accepted'