mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 23:41:17 -05:00
[WIP]
This commit is contained in:
@@ -7,7 +7,7 @@ from app.notifications.notifications_ses_callback import remove_emails_from_comp
|
||||
|
||||
from tests.app.db import (
|
||||
create_notification, ses_complaint_callback,
|
||||
ses_notification_callback
|
||||
ses_notification_callback,
|
||||
)
|
||||
|
||||
|
||||
@@ -40,8 +40,7 @@ def test_process_ses_results_retry_called(notify_db, mocker):
|
||||
def test_process_ses_results_in_complaint(sample_email_template, mocker):
|
||||
notification = create_notification(template=sample_email_template, reference='ref1')
|
||||
mocked = mocker.patch("app.dao.notifications_dao.update_notification_status_by_reference")
|
||||
response = json.loads(ses_complaint_callback())
|
||||
process_ses_results(response=response)
|
||||
process_ses_results(response=ses_complaint_callback())
|
||||
assert mocked.call_count == 0
|
||||
complaints = Complaint.query.all()
|
||||
assert len(complaints) == 1
|
||||
@@ -49,7 +48,6 @@ def test_process_ses_results_in_complaint(sample_email_template, mocker):
|
||||
|
||||
|
||||
def test_remove_emails_from_complaint():
|
||||
test_message = ses_complaint_callback()
|
||||
test_json = json.loads(json.loads(test_message)['Message'])
|
||||
test_json = json.loads(ses_complaint_callback()['Message'])
|
||||
remove_emails_from_complaint(test_json)
|
||||
assert "recipient1@example.com" not in test_json
|
||||
|
||||
Reference in New Issue
Block a user