From 852c16c066c1771bbc4656e6a3142f201d277907 Mon Sep 17 00:00:00 2001 From: Charley Cunningham Date: Sat, 23 Sep 2023 12:25:28 -0400 Subject: [PATCH] Fix AlertRegistrationTestCase --- backend/courses/models.py | 1 - backend/tests/alert/test_alert.py | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/backend/courses/models.py b/backend/courses/models.py index 5da3b8023..da84e82ae 100644 --- a/backend/courses/models.py +++ b/backend/courses/models.py @@ -1369,7 +1369,6 @@ def validate_phone(value): return try: parsed_number = phonenumbers.parse(value, "US") - print(parsed_number) if not phonenumbers.is_valid_number(parsed_number): raise ValueError(f"Invalid phone number '{value}'.") except (phonenumbers.phonenumberutil.NumberParseException, ValueError) as e: diff --git a/backend/tests/alert/test_alert.py b/backend/tests/alert/test_alert.py index 14c072918..817ccf439 100644 --- a/backend/tests/alert/test_alert.py +++ b/backend/tests/alert/test_alert.py @@ -1031,7 +1031,7 @@ def setUp(self): self.user = User.objects.create_user(username="jacob", password="top_secret") self.user.save() self.user.profile.email = "j@gmail.com" - self.user.profile.phone = "+119178286431" + self.user.profile.phone = "+19178286431" self.user.profile.save() self.user = User.objects.get(username="jacob") self.client = APIClient() @@ -1124,7 +1124,7 @@ def simulate_alert( contact_infos = ( # If we enabled push notifications by default in these tests, push_username would be # set to "jacob", since that is the username of the default user for these tests. - [{"number": "+119178286431", "email": "j@gmail.com", "push_username": None}] + [{"number": "+19178286431", "email": "j@gmail.com", "push_username": None}] if contact_infos is None else contact_infos ) @@ -1673,7 +1673,7 @@ def push_notification_simple_test(self): "email": new_user.profile.email, "push_username": new_user.username, }, - {"number": "+119178286431", "email": "j@gmail.com", "push_username": None}, + {"number": "+19178286431", "email": "j@gmail.com", "push_username": None}, ], should_send=True, close_notification=False, @@ -1743,7 +1743,7 @@ def registrations_multiple_users_helper(self, ids, auto_resub=False): self.cis1200, 5, [ - {"number": "+119178286431", "email": "j@gmail.com"}, + {"number": "+19178286431", "email": "j@gmail.com"}, {"number": "+12234567890", "email": "newj@gmail.com"}, ], ) @@ -2435,7 +2435,7 @@ def close_notification_creation_helper(self, push_notif): possible cases; with push notifications enabled (push_notif parameter set to True), or disabled (push_notif set to False). """ - contact_infos = [{"number": "+119178286431", "email": "j@gmail.com", "push_username": None}] + contact_infos = [{"number": "+19178286431", "email": "j@gmail.com", "push_username": None}] if push_notif: response = self.client.put( reverse("user-view"), @@ -2574,7 +2574,7 @@ def close_notification_cancel_helper(self, delete=False): Ensure that cancelling or deleting a registration also cancels a pending close notification """ contact_infos = [ - {"number": "+119178286431", "email": "j@gmail.com", "push_username": self.user.username} + {"number": "+19178286431", "email": "j@gmail.com", "push_username": self.user.username} ] first_id = self.registration_cis1200.id