Normalize outbound SMS number for job notifications

Replaces 0 with 44 in UK SMS sender number to make it possible to
respond to the SMS from an international number.
This commit is contained in:
Alexey Bezhan
2017-12-18 16:14:09 +00:00
parent 577fe623b0
commit 545ff7dda6
2 changed files with 21 additions and 1 deletions

View File

@@ -1081,6 +1081,25 @@ def test_save_letter_uses_template_reply_to_text(mocker, notify_db_session):
assert notification_db.reply_to_text == "Template address contact"
def test_save_sms_uses_sms_sender_reply_to_text(mocker, notify_db_session):
service = create_service_with_defined_sms_sender(sms_sender_value='07123123123')
template = create_template(service=service)
notification = _notification_json(template, to="07700 900205")
mocker.patch('app.celery.provider_tasks.deliver_sms.apply_async')
notification_id = uuid.uuid4()
save_sms(
service.id,
notification_id,
encryption.encrypt(notification),
key_type=KEY_TYPE_TEST
)
persisted_notification = Notification.query.one()
assert persisted_notification.reply_to_text == '447123123123'
def test_save_letter_calls_update_noti_to_sent_task_with_letters_as_pdf_permission_in_research_mode(
mocker, notify_db_session, sample_letter_job):
sample_letter_job.service.research_mode = True