mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 18:01:08 -05:00
Updated text send to user for the authorization code.
This commit is contained in:
@@ -321,7 +321,8 @@ def send_sms_code(encrypted_verification):
|
|||||||
verification_message = encryption.decrypt(encrypted_verification)
|
verification_message = encryption.decrypt(encrypted_verification)
|
||||||
try:
|
try:
|
||||||
mmg_client.send_sms(validate_and_format_phone_number(verification_message['to']),
|
mmg_client.send_sms(validate_and_format_phone_number(verification_message['to']),
|
||||||
verification_message['secret_code'],
|
"{} is your Notify authentication code".format(
|
||||||
|
verification_message['secret_code']),
|
||||||
'send-sms-code')
|
'send-sms-code')
|
||||||
except MMGClientException as e:
|
except MMGClientException as e:
|
||||||
current_app.logger.exception(e)
|
current_app.logger.exception(e)
|
||||||
@@ -341,7 +342,8 @@ def send_email_code(encrypted_verification_message):
|
|||||||
aws_ses_client.send_email(current_app.config['VERIFY_CODE_FROM_EMAIL_ADDRESS'],
|
aws_ses_client.send_email(current_app.config['VERIFY_CODE_FROM_EMAIL_ADDRESS'],
|
||||||
verification_message['to'],
|
verification_message['to'],
|
||||||
"Verification code",
|
"Verification code",
|
||||||
verification_message['secret_code'])
|
"{} is your Notify authentication code".format(
|
||||||
|
verification_message['secret_code']))
|
||||||
except AwsSesClientException as e:
|
except AwsSesClientException as e:
|
||||||
current_app.logger.exception(e)
|
current_app.logger.exception(e)
|
||||||
|
|
||||||
|
|||||||
@@ -744,9 +744,10 @@ def test_should_send_sms_code(mocker):
|
|||||||
|
|
||||||
mocker.patch('app.mmg_client.send_sms')
|
mocker.patch('app.mmg_client.send_sms')
|
||||||
send_sms_code(encrypted_notification)
|
send_sms_code(encrypted_notification)
|
||||||
mmg_client.send_sms.assert_called_once_with(format_phone_number(validate_phone_number(notification['to'])),
|
mmg_client.send_sms.assert_called_once_with(
|
||||||
notification['secret_code'],
|
format_phone_number(validate_phone_number(notification['to'])),
|
||||||
'send-sms-code')
|
"{} is your Notify authentication code".format(notification['secret_code']),
|
||||||
|
'send-sms-code')
|
||||||
|
|
||||||
|
|
||||||
def test_should_throw_mmg_client_exception(mocker):
|
def test_should_throw_mmg_client_exception(mocker):
|
||||||
@@ -756,9 +757,10 @@ def test_should_throw_mmg_client_exception(mocker):
|
|||||||
encrypted_notification = encryption.encrypt(notification)
|
encrypted_notification = encryption.encrypt(notification)
|
||||||
mocker.patch('app.mmg_client.send_sms', side_effect=MMGClientException(mmg_error))
|
mocker.patch('app.mmg_client.send_sms', side_effect=MMGClientException(mmg_error))
|
||||||
send_sms_code(encrypted_notification)
|
send_sms_code(encrypted_notification)
|
||||||
mmg_client.send_sms.assert_called_once_with(format_phone_number(validate_phone_number(notification['to'])),
|
mmg_client.send_sms.assert_called_once_with(
|
||||||
notification['secret_code'],
|
format_phone_number(validate_phone_number(notification['to'])),
|
||||||
'send-sms-code')
|
"{} is your Notify authentication code".format(notification['secret_code']),
|
||||||
|
'send-sms-code')
|
||||||
|
|
||||||
|
|
||||||
def test_should_send_email_code(mocker):
|
def test_should_send_email_code(mocker):
|
||||||
@@ -774,7 +776,7 @@ def test_should_send_email_code(mocker):
|
|||||||
current_app.config['VERIFY_CODE_FROM_EMAIL_ADDRESS'],
|
current_app.config['VERIFY_CODE_FROM_EMAIL_ADDRESS'],
|
||||||
verification['to'],
|
verification['to'],
|
||||||
"Verification code",
|
"Verification code",
|
||||||
verification['secret_code']
|
"{} is your Notify authentication code".format(verification['secret_code'])
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user