Fix to handle_complaints.

The json we were getting from SES was not quite as expected, the test data now reflects what we get.
New test added, fix a test that was passing regardless.
This commit is contained in:
Rebecca Law
2018-06-06 10:37:31 +01:00
parent c5524a3fe9
commit 4966da8289
4 changed files with 16 additions and 7 deletions

View File

@@ -50,4 +50,4 @@ def test_process_ses_results_in_complaint(sample_email_template, mocker):
def test_remove_emails_from_complaint():
test_json = json.loads(ses_complaint_callback()['Message'])
remove_emails_from_complaint(test_json)
assert "recipient1@example.com" not in test_json
assert "recipient1@example.com" not in json.dumps(test_json)