Mark a declined message from Firetext as permanent-failure rather than failed.

This commit is contained in:
Rebecca Law
2016-05-24 15:32:48 +01:00
parent 06473431ba
commit fa152c4431
3 changed files with 3 additions and 3 deletions

View File

@@ -21,7 +21,7 @@ firetext_responses = {
"message": 'Declined', "message": 'Declined',
"success": False, "success": False,
"notification_statistics_status": STATISTICS_FAILURE, "notification_statistics_status": STATISTICS_FAILURE,
"notification_status": 'failed' "notification_status": 'permanent-failure'
}, },
'2': { '2': {
"message": 'Undelivered (Pending with Network)', "message": 'Undelivered (Pending with Network)',

View File

@@ -14,7 +14,7 @@ def test_should_return_correct_details_for_delivery():
def test_should_return_correct_details_for_bounced(): def test_should_return_correct_details_for_bounced():
response_dict = get_firetext_responses('1') response_dict = get_firetext_responses('1')
assert response_dict['message'] == 'Declined' assert response_dict['message'] == 'Declined'
assert response_dict['notification_status'] == 'failed' assert response_dict['notification_status'] == 'permanent-failure'
assert response_dict['notification_statistics_status'] == 'failure' assert response_dict['notification_statistics_status'] == 'failure'
assert not response_dict['success'] assert not response_dict['success']

View File

@@ -1234,7 +1234,7 @@ def test_firetext_callback_should_update_notification_status_failed(notify_api,
assert json_resp['message'] == 'Firetext callback succeeded. reference {} updated'.format( assert json_resp['message'] == 'Firetext callback succeeded. reference {} updated'.format(
sample_notification.id sample_notification.id
) )
assert get_notification_by_id(sample_notification.id).status == 'failed' assert get_notification_by_id(sample_notification.id).status == 'permanent-failure'
stats = dao_get_notification_statistics_for_service(sample_notification.service_id)[0] stats = dao_get_notification_statistics_for_service(sample_notification.service_id)[0]
assert stats.sms_delivered == 0 assert stats.sms_delivered == 0
assert stats.sms_requested == 1 assert stats.sms_requested == 1