mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-16 20:48:37 -04:00
remove reply_to_addresses from task kwargs
also added a test for aws_ses.send_email to prove it handles reply_to_address correctly
This commit is contained in:
@@ -447,33 +447,3 @@ def test_send_email_to_provider_should_not_send_to_provider_when_status_is_not_c
|
||||
|
||||
app.aws_ses_client.send_email.assert_not_called()
|
||||
app.celery.research_mode_tasks.send_email_response.apply_async.assert_not_called()
|
||||
|
||||
|
||||
def test_send_email_should_use_service_reply_to_email(
|
||||
notify_db, notify_db_session,
|
||||
sample_service,
|
||||
sample_email_template,
|
||||
mocker):
|
||||
mocker.patch('app.statsd_client.incr')
|
||||
mocker.patch('app.statsd_client.timing')
|
||||
mocker.patch('app.aws_ses_client.send_email', return_value='reference')
|
||||
mocker.patch('app.aws_ses_client.get_name', return_value="ses")
|
||||
mocker.patch('app.celery.research_mode_tasks.send_email_response.apply_async')
|
||||
|
||||
db_notification = sample_notification(notify_db, notify_db_session, template=sample_email_template)
|
||||
sample_service.reply_to_email_address = 'foo@bar.com'
|
||||
|
||||
send_email_to_provider(
|
||||
db_notification.service_id,
|
||||
db_notification.id,
|
||||
reply_to_addresses="waz@baz.com"
|
||||
)
|
||||
|
||||
aws_ses_client.send_email.assert_called_once_with(
|
||||
ANY,
|
||||
ANY,
|
||||
ANY,
|
||||
body=ANY,
|
||||
html_body=ANY,
|
||||
reply_to_address=sample_service.reply_to_email_address
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user