From 828671ecfc4e15fb4408c0bf0d68348abcad1a2b Mon Sep 17 00:00:00 2001 From: Ryan Ahearn Date: Fri, 6 Jan 2023 11:14:45 -0500 Subject: [PATCH] Remove obsolete strip_leading_plus_one method --- app/notifications/receive_notifications.py | 8 -------- .../app/notifications/test_receive_notification.py | 14 -------------- 2 files changed, 22 deletions(-) diff --git a/app/notifications/receive_notifications.py b/app/notifications/receive_notifications.py index 9343aa1d5..ae0997217 100644 --- a/app/notifications/receive_notifications.py +++ b/app/notifications/receive_notifications.py @@ -134,11 +134,3 @@ def fetch_potential_service(inbound_number, provider_name): def has_inbound_sms_permissions(permissions): str_permissions = [p.permission for p in permissions] return set([INBOUND_SMS_TYPE, SMS_TYPE]).issubset(set(str_permissions)) - - -def strip_leading_plus_one(number): - if number.startswith('+'): - number = number.replace('+', '', 1) - if number.startswith('1'): - number = number.replace('1', '', 1) - return number diff --git a/tests/app/notifications/test_receive_notification.py b/tests/app/notifications/test_receive_notification.py index e90a29896..89577b3ad 100644 --- a/tests/app/notifications/test_receive_notification.py +++ b/tests/app/notifications/test_receive_notification.py @@ -8,7 +8,6 @@ from app.models import EMAIL_TYPE, INBOUND_SMS_TYPE, SMS_TYPE, InboundSms from app.notifications.receive_notifications import ( create_inbound_sms_object, has_inbound_sms_permissions, - strip_leading_plus_one, unescape_string, ) from tests.app.db import ( @@ -238,19 +237,6 @@ def test_receive_notification_error_if_not_single_matching_service(client, notif assert InboundSms.query.count() == 0 -@pytest.mark.parametrize( - 'number, expected', - [ - ('12028675309', '2028675309'), - ('+12028675309', '2028675309'), - ('2028675309', '2028675309'), - ('15111111111', '5111111111') - ] -) -def test_strip_leading_country_code(number, expected): - assert strip_leading_plus_one(number) == expected - - @pytest.mark.skip(reason="Need to implement inbound SNS tests. Body here from MMG") @pytest.mark.parametrize("auth, keys, status_code", [ ["testkey", ["testkey"], 200],