mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 10:53:28 -05:00
of the name against a list of all service email_from fields. Update find_all_service_names to find_all_service_email_from, which returns the email_from of all services.
13 lines
502 B
Python
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
|