mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 18:31:13 -05:00
Update tests to focus on US numbers
This commit is contained in:
@@ -117,10 +117,10 @@ def test_should_send_personalised_template_to_correct_sms_provider_and_persist(
|
||||
mocker
|
||||
):
|
||||
db_notification = create_notification(template=sample_sms_template_with_html,
|
||||
to_field="5558675309", personalisation={"name": "Jo"},
|
||||
to_field="2028675309", personalisation={"name": "Jo"},
|
||||
status='created',
|
||||
reply_to_text=sample_sms_template_with_html.service.get_default_sms_sender(),
|
||||
normalised_to="5558675309"
|
||||
normalised_to="2028675309"
|
||||
)
|
||||
|
||||
mocker.patch('app.aws_sns_client.send_sms')
|
||||
@@ -130,7 +130,7 @@ def test_should_send_personalised_template_to_correct_sms_provider_and_persist(
|
||||
)
|
||||
|
||||
aws_sns_client.send_sms.assert_called_once_with(
|
||||
to="5558675309",
|
||||
to="2028675309",
|
||||
content="Sample service: Hello Jo\nHere is <em>some HTML</em> & entities",
|
||||
reference=str(db_notification.id),
|
||||
sender=current_app.config['FROM_NUMBER'],
|
||||
@@ -210,9 +210,9 @@ def test_should_not_send_sms_message_when_service_is_inactive_notification_is_in
|
||||
def test_send_sms_should_use_template_version_from_notification_not_latest(
|
||||
sample_template,
|
||||
mocker):
|
||||
db_notification = create_notification(template=sample_template, to_field='5558675309', status='created',
|
||||
db_notification = create_notification(template=sample_template, to_field='2028675309', status='created',
|
||||
reply_to_text=sample_template.service.get_default_sms_sender(),
|
||||
normalised_to='5558675309')
|
||||
normalised_to='2028675309')
|
||||
|
||||
mocker.patch('app.aws_sns_client.send_sms')
|
||||
|
||||
@@ -234,7 +234,7 @@ def test_send_sms_should_use_template_version_from_notification_not_latest(
|
||||
)
|
||||
|
||||
aws_sns_client.send_sms.assert_called_once_with(
|
||||
to="5558675309",
|
||||
to="2028675309",
|
||||
content="Sample service: This is a template:\nwith a newline",
|
||||
reference=str(db_notification.id),
|
||||
sender=current_app.config['FROM_NUMBER'],
|
||||
@@ -737,8 +737,8 @@ def test_send_sms_to_provider_should_use_normalised_to(
|
||||
):
|
||||
send_mock = mocker.patch('app.aws_sns_client.send_sms')
|
||||
notification = create_notification(template=sample_template,
|
||||
to_field='+15558675309',
|
||||
normalised_to='5558675309')
|
||||
to_field='+12028675309',
|
||||
normalised_to='2028675309')
|
||||
send_to_providers.send_sms_to_provider(notification)
|
||||
send_mock.assert_called_once_with(to=notification.normalised_to,
|
||||
content=ANY,
|
||||
|
||||
Reference in New Issue
Block a user