Add some useful information to the log.

Fix unit test to actually test the right thing
This commit is contained in:
Rebecca Law
2018-06-07 12:30:04 +01:00
parent 7511c36dd7
commit 56c6d5101c
3 changed files with 21 additions and 15 deletions

View File

@@ -2,8 +2,9 @@ import json
from datetime import datetime
from app.celery.process_ses_receipts_tasks import process_ses_results
from app.celery.research_mode_tasks import ses_hard_bounce_callback
from app.models import Complaint
from app.notifications.notifications_ses_callback import remove_emails_from_complaint
from app.notifications.notifications_ses_callback import remove_emails_from_complaint, remove_emails_from_bounce
from tests.app.db import (
create_notification, ses_complaint_callback,
@@ -51,3 +52,9 @@ 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 json.dumps(test_json)
def test_remove_email_from_bounce():
test_json = json.loads(ses_hard_bounce_callback(reference='ref1')['Message'])
remove_emails_from_bounce(test_json)
assert "bounce@simulator.amazonses.com" not in json.dumps(test_json)