Update ses callback to interpret hard and soft bounces.

If the notification has a status == sending then update the status otherwise do not update the status.
In other words do not change the status more than once.
This commit is contained in:
Rebecca Law
2016-05-17 15:38:49 +01:00
parent 4762aef1aa
commit 281a93b32d
6 changed files with 212 additions and 62 deletions

View File

@@ -11,10 +11,18 @@ def test_should_return_correct_details_for_delivery():
assert response_dict['success']
def test_should_return_correct_details_for_bounced():
response_dict = get_aws_responses('Bounce')
assert response_dict['message'] == 'Bounced'
assert response_dict['notification_status'] == 'failed'
def test_should_return_correct_details_for_hard_bounced():
response_dict = get_aws_responses('Permanent')
assert response_dict['message'] == 'Hard bounced'
assert response_dict['notification_status'] == 'permanent-failure'
assert response_dict['notification_statistics_status'] == 'failure'
assert not response_dict['success']
def test_should_return_correct_details_for_soft_bounced():
response_dict = get_aws_responses('Temporary')
assert response_dict['message'] == 'Soft bounced'
assert response_dict['notification_status'] == 'temporary-failure'
assert response_dict['notification_statistics_status'] == 'failure'
assert not response_dict['success']