mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-23 08:51:30 -05:00
[WIP]
This commit is contained in:
@@ -201,23 +201,22 @@ def test_remove_emails_from_bounce():
|
||||
|
||||
def test_process_ses_results_in_complaint(sample_email_template):
|
||||
notification = create_notification(template=sample_email_template, reference='ref1')
|
||||
response = json.loads(ses_complaint_callback())
|
||||
handle_complaint(response)
|
||||
handle_complaint(ses_complaint_callback())
|
||||
complaints = Complaint.query.all()
|
||||
assert len(complaints) == 1
|
||||
assert complaints[0].notification_id == notification.id
|
||||
|
||||
|
||||
def test_handle_complaint_does_not_raise_exception_if_reference_is_missing(notify_api):
|
||||
response = json.loads(ses_complaint_callback_malformed_message_id())
|
||||
response = json.loads(ses_complaint_callback_malformed_message_id()['Message'])
|
||||
handle_complaint(response)
|
||||
assert len(Complaint.query.all()) == 0
|
||||
|
||||
|
||||
def test_process_ses_results_in_complaint_save_complaint_with_null_complaint_type(notify_api, sample_email_template):
|
||||
notification = create_notification(template=sample_email_template, reference='ref1')
|
||||
response = json.loads(ses_complaint_callback_with_missing_complaint_type())
|
||||
handle_complaint(response)
|
||||
msg = json.loads(ses_complaint_callback_with_missing_complaint_type()['Message'])
|
||||
handle_complaint(msg)
|
||||
complaints = Complaint.query.all()
|
||||
assert len(complaints) == 1
|
||||
assert complaints[0].notification_id == notification.id
|
||||
|
||||
Reference in New Issue
Block a user