Use Firetext client

This commit is contained in:
Rebecca Law
2016-02-17 15:52:09 +00:00
parent 7afa87c367
commit 66cf6cfd30
2 changed files with 7 additions and 7 deletions

View File

@@ -37,6 +37,6 @@ def send_sms_code(encrypted_notification):
notification = encryption.decrypt(encrypted_notification) notification = encryption.decrypt(encrypted_notification)
try: try:
twilio_client.send_sms(notification['to'], notification['secret_code']) firetext_client.send_sms(notification['to'], notification['secret_code'])
except TwilioClientException as e: except FiretextClientException as e:
current_app.logger.debug(e) current_app.logger.debug(e)

View File

@@ -85,16 +85,16 @@ def test_should_send_sms_code(mocker):
encrypted_notification = encryption.encrypt(notification) encrypted_notification = encryption.encrypt(notification)
mocker.patch('app.twilio_client.send_sms') mocker.patch('app.firetext_client.send_sms')
send_sms_code(encrypted_notification) send_sms_code(encrypted_notification)
twilio_client.send_sms.assert_called_once_with(notification['to'], notification['secret_code']) firetext_client.send_sms.assert_called_once_with(notification['to'], notification['secret_code'])
def test_should_throw_twilio_exception(mocker): def test_should_log_firetext_client_exception(mocker):
notification = {'to': '+441234123123', notification = {'to': '+441234123123',
'secret_code': '12345'} 'secret_code': '12345'}
encrypted_notification = encryption.encrypt(notification) encrypted_notification = encryption.encrypt(notification)
mocker.patch('app.twilio_client.send_sms', side_effect=TwilioClientException) mocker.patch('app.firetext_client.send_sms', side_effect=FiretextClientException)
send_sms_code(encrypted_notification) send_sms_code(encrypted_notification)
twilio_client.send_sms.assert_called_once_with(notification['to'], notification['secret_code']) firetext_client.send_sms.assert_called_once_with(notification['to'], notification['secret_code'])