validate email addresses in one-off flow

previously we were just using the wtforms builtin email validator,
which is much more relaxed than our own one. It'd catch bad emails when
POSTing to the API, resulting in an ugly error message. It's easy work
to make sure we validate email addresses as soon as they're entered.
This commit is contained in:
Leo Hemsted
2018-02-14 14:35:16 +00:00
parent 34f1b40dbc
commit 31a4cc15c9
3 changed files with 22 additions and 4 deletions

View File

@@ -22,6 +22,7 @@ def test_form_class_not_mutated(app_):
(False, 'email address', '', 'Cant be empty'),
(False, 'email address', '12345', 'Enter a valid email address'),
(False, 'email address', '“bad”@email-address.com', 'Enter a valid email address'),
(False, 'email address', 'test@example.com', None),
(False, 'email address', 'test@example.gov.uk', None),