mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 18:31:13 -05:00
I have an issue with the test, not sure why?
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
import uuid
|
||||
import pytest
|
||||
from app.celery.tasks import (send_sms, send_sms_code)
|
||||
from app import twilio_client, encryption
|
||||
from app.clients.sms.twilio import TwilioClientException
|
||||
from app.celery.tasks import send_sms
|
||||
from app import firetext_client
|
||||
from app.celery.tasks import (send_sms, send_sms_code, send_email_code)
|
||||
from app import (firetext_client, aws_ses_client, encryption)
|
||||
from app.clients.sms.firetext import FiretextClientException
|
||||
from app.dao import notifications_dao
|
||||
from sqlalchemy.exc import SQLAlchemyError
|
||||
@@ -98,3 +95,20 @@ def test_should_log_firetext_client_exception(mocker):
|
||||
mocker.patch('app.firetext_client.send_sms', side_effect=FiretextClientException)
|
||||
send_sms_code(encrypted_notification)
|
||||
firetext_client.send_sms.assert_called_once_with(notification['to'], notification['secret_code'])
|
||||
|
||||
|
||||
def test_should_send_email_code(mocker):
|
||||
notification = {'to_address': 'someone@it.gov.uk',
|
||||
'from_address': 'no-reply@notify.gov.uk',
|
||||
'subject': 'Verification code',
|
||||
'body': 11111}
|
||||
|
||||
encrypted_notification = encryption.encrypt(notification)
|
||||
mocker.patch('app.aws_ses_client.send_email')
|
||||
|
||||
send_email_code(encrypted_notification)
|
||||
|
||||
aws_ses_client.send_email.assert_called_once_with((notification['from_address'],
|
||||
notification['to_address'],
|
||||
notification['subject'],
|
||||
notification['body']))
|
||||
|
||||
Reference in New Issue
Block a user