mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 23:55:58 -05:00
Merge pull request #788 from GSA/notify-api-784
notify-api-784 remove simulated numbers
This commit is contained in:
@@ -118,7 +118,10 @@ def extract_phones(job):
|
||||
current_app.logger.info(f"LENGTH OF ROW IS {len(row)}")
|
||||
if phone_index >= len(row):
|
||||
phones[job_row] = "Error: can't retrieve phone number"
|
||||
current_app.logger.error("Corrupt csv file")
|
||||
current_app.logger.error(
|
||||
"Corrupt csv file, missing columns or possibly a byte order mark in the file"
|
||||
)
|
||||
|
||||
else:
|
||||
my_phone = row[phone_index]
|
||||
my_phone = re.sub(r"[\+\s\(\)\-\.]*", "", my_phone)
|
||||
|
||||
@@ -283,7 +283,8 @@ class Config(object):
|
||||
"simulate-delivered-2@notifications.service.gov.uk",
|
||||
"simulate-delivered-3@notifications.service.gov.uk",
|
||||
)
|
||||
SIMULATED_SMS_NUMBERS = ("+12028675000", "+12028675111", "+12028675222")
|
||||
# 7755 is success, 7167 is failure
|
||||
SIMULATED_SMS_NUMBERS = ("+14254147755", "+14254147167")
|
||||
|
||||
FREE_SMS_TIER_FRAGMENT_COUNT = 250000
|
||||
|
||||
|
||||
@@ -254,11 +254,8 @@ def test_send_notification_to_queue_throws_exception_deletes_notification(
|
||||
@pytest.mark.parametrize(
|
||||
"to_address, notification_type, expected",
|
||||
[
|
||||
("+12028675000", "sms", True),
|
||||
("+12028675111", "sms", True),
|
||||
("+12028675222", "sms", True),
|
||||
("2028675000", "sms", True),
|
||||
("2028675111", "sms", True),
|
||||
("+14254147755", "sms", True),
|
||||
("+14254147167", "sms", True),
|
||||
("simulate-delivered@notifications.service.gov.uk", "email", True),
|
||||
("simulate-delivered-2@notifications.service.gov.uk", "email", True),
|
||||
("simulate-delivered-3@notifications.service.gov.uk", "email", True),
|
||||
@@ -275,7 +272,7 @@ def test_simulated_recipient(notify_api, to_address, notification_type, expected
|
||||
'simulate-delivered-2@notifications.service.gov.uk',
|
||||
'simulate-delivered-2@notifications.service.gov.uk'
|
||||
)
|
||||
SIMULATED_SMS_NUMBERS = ('+12028675000', '+12028675111', '+12028675222')
|
||||
SIMULATED_SMS_NUMBERS = ("+14254147755", "+14254147167")
|
||||
"""
|
||||
formatted_address = None
|
||||
|
||||
|
||||
@@ -881,7 +881,7 @@ def test_should_not_persist_notification_or_send_email_if_simulated_email(
|
||||
assert Notification.query.count() == 0
|
||||
|
||||
|
||||
@pytest.mark.parametrize("to_sms", ["2028675000", "2028675111", "+12028675222"])
|
||||
@pytest.mark.parametrize("to_sms", ["+14254147755", "+14254147167"])
|
||||
def test_should_not_persist_notification_or_send_sms_if_simulated_number(
|
||||
client, to_sms, sample_template, mocker
|
||||
):
|
||||
|
||||
@@ -532,9 +532,8 @@ def test_post_email_notification_returns_201(
|
||||
("simulate-delivered@notifications.service.gov.uk", EMAIL_TYPE),
|
||||
("simulate-delivered-2@notifications.service.gov.uk", EMAIL_TYPE),
|
||||
("simulate-delivered-3@notifications.service.gov.uk", EMAIL_TYPE),
|
||||
("2028675000", "sms"),
|
||||
("2028675111", "sms"),
|
||||
("2028675222", "sms"),
|
||||
("+14254147167", "sms"),
|
||||
("+14254147755", "sms"),
|
||||
],
|
||||
)
|
||||
def test_should_not_persist_or_send_notification_if_simulated_recipient(
|
||||
|
||||
Reference in New Issue
Block a user