Make form error messages consistent

We were using a bunch of different styles for form error messages,
including:
- having the name of the field in the error, or not
- can not/cannot/can’t (GDS content styleguide recommends using
  contractions)
This commit is contained in:
Chris Hill-Scott
2016-04-04 10:42:04 +01:00
parent b9cd669439
commit 953be15d84
3 changed files with 19 additions and 19 deletions

View File

@@ -44,7 +44,7 @@ def test_should_return_form_errors_when_service_name_is_empty(app_,
client.login(api_user_active, mocker)
response = client.post(url_for('main.add_service'), data={})
assert response.status_code == 200
assert 'Service name cant be empty' in response.get_data(as_text=True)
assert 'Cant be empty' in response.get_data(as_text=True)
def test_should_return_form_errors_with_duplicate_service_name_regardless_of_case(app_,

View File

@@ -260,7 +260,7 @@ def test_user_cant_invite_themselves(
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
assert page.h1.string.strip() == 'Invite a team member'
form_error = page.find('span', class_='error-message').string.strip()
assert form_error == "You can't send an invitation to yourself"
assert form_error == "You cant send an invitation to yourself"
assert not mock_create_invite.called