Remove email from the log message

This commit is contained in:
Rebecca Law
2018-05-30 16:45:18 +01:00
parent 621c81a9d8
commit 23e6b57c26
2 changed files with 13 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ import json
from datetime import datetime
from app.celery.process_ses_receipts_tasks import process_ses_results
from app.notifications.notifications_ses_callback import remove_emails_from_complaint
from tests.app.db import create_notification
@@ -39,6 +40,13 @@ def test_process_ses_results_in_complaint(notify_db, mocker):
assert mocked.call_count == 0
def test_remove_emails_from_complaint():
test_message = ses_complaint_callback()
test_json = json.loads(json.loads(test_message)['Message'])
remove_emails_from_complaint(test_json)
assert "recipient1@example.com" not in test_json
def ses_notification_callback():
return '{\n "Type" : "Notification",\n "MessageId" : "ref1",' \
'\n "TopicArn" : "arn:aws:sns:eu-west-1:123456789012:testing",' \