Replace UK phone numbers in tests with US numbers

This commit is contained in:
Ryan Ahearn
2022-12-22 22:11:07 -05:00
parent cc142666d5
commit 2ad21a6f4f
35 changed files with 483 additions and 478 deletions

View File

@@ -14,7 +14,6 @@ from notifications_utils.formatters import strip_all_whitespace
from notifications_utils.insensitive_dict import InsensitiveDict
from notifications_utils.recipients import (
InvalidPhoneError,
normalise_phone_number,
validate_phone_number,
)
from werkzeug.utils import cached_property
@@ -1538,10 +1537,9 @@ class ServiceContactDetailsForm(StripWhitespaceForm):
self.email_address.validators = [DataRequired(), Length(min=5, max=255), ValidEmail()]
elif self.contact_details_type.data == 'phone_number':
# we can't use the existing phone number validation functions here since we want to allow landlines
def valid_phone_number(self, num):
try:
normalise_phone_number(num.data)
validate_phone_number(num.data, international=True)
return True
except InvalidPhoneError:
raise ValidationError('Must be a valid phone number')

View File

@@ -79,7 +79,7 @@
{% call(item, row_number) list_table(
[
['phone number'],
['07700 900123'],
['555-867-5309'],
],
caption="Example",
caption_visible=False,