mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
Work in progress, all tests passing and implemented mocks for services_dao.
This commit is contained in:
@@ -5,8 +5,10 @@ from werkzeug.datastructures import MultiDict
|
||||
def test_form_should_have_errors_when_duplicate_service_is_added(app_,
|
||||
db_,
|
||||
db_session):
|
||||
def _get_form_names():
|
||||
return ['some service', 'more names']
|
||||
with app_.test_request_context():
|
||||
form = AddServiceForm(['some service', 'more names'],
|
||||
form = AddServiceForm(_get_form_names,
|
||||
formdata=MultiDict([('service_name', 'some service')]))
|
||||
form.validate()
|
||||
assert {'service_name': ['Service name already exists']} == form.errors
|
||||
|
||||
Reference in New Issue
Block a user