Refactor to use validator class

Using a separate validator class to check for appropriate characters in
a text message sender means that we’re not doing this validation in a
different way from the other checks (length and required). So the code
is cleaner.
This commit is contained in:
Chris Hill-Scott
2018-01-31 10:26:37 +00:00
parent 532458cf3c
commit b11653fe08
3 changed files with 25 additions and 8 deletions

View File

@@ -810,7 +810,8 @@ def test_incorrect_letter_contact_block_input(
@pytest.mark.parametrize('sms_sender_input, expected_error', [
('', 'Cant be empty'),
('abcdefghijkhgkg', 'Enter 11 characters or fewer')
('abcdefghijkhgkg', 'Enter 11 characters or fewer'),
(' ¯\_(ツ)_/¯ ', 'Use letters and numbers only'),
])
def test_incorrect_sms_sender_input(
sms_sender_input,