Add the new field to the application

This commit replaces the previous `StringField` used for collecting mobile
phone numbers with the `UKMobileNumber` field.

This means changing a few of the preexisting tests to have more realistic mobile
numbers so that they still pass.
This commit is contained in:
Chris Hill-Scott
2016-01-13 09:26:38 +00:00
parent 791324588b
commit aa43bd9e75
3 changed files with 8 additions and 10 deletions

View File

@@ -65,10 +65,8 @@ class UKMobileNumber(StringField):
def mobile_number():
mobile_number_regex = "^\\+44[\\d]{10}$"
return StringField('Mobile phone number',
validators=[DataRequired(message='Mobile number can not be empty'),
Regexp(regex=mobile_number_regex, message='Enter a +44 mobile number')])
return UKMobileNumber('Mobile phone number',
validators=[DataRequired(message='Cannot be empty')])
def password():