Files
notifications-admin/tests/app/main/test_add_service_form.py
Chris Hill-Scott f129cc3db2 Reword the add service page
Without the preview service name we probably have to go back to communicating
a bit more on the add service page. This commit brings back the two bullet
points about where the service name will appear, and tries to tie it into the
nice words that Matt Sheret wrote for us.
2016-02-26 13:17:58 +00:00

13 lines
502 B
Python

from app.main.forms import AddServiceForm
from werkzeug.datastructures import MultiDict
def test_form_should_have_errors_when_duplicate_service_is_added(app_):
def _get_form_names():
return ['some service', 'more names']
with app_.test_request_context():
form = AddServiceForm(_get_form_names,
formdata=MultiDict([('name', 'some service')]))
form.validate()
assert {'name': ['This service name is already in use']} == form.errors