mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-09 17:45:32 -04:00
Validate service and organisation name
This commit is contained in:
@@ -160,6 +160,29 @@ def test_create_new_organisation_validates(
|
||||
assert mock_create_organisation.called is False
|
||||
|
||||
|
||||
def test_create_new_organisation_fails_if_new_name_has_less_than_2_alphanumeric_characters(
|
||||
client_request,
|
||||
platform_admin_user,
|
||||
mocker,
|
||||
):
|
||||
mock_create_organisation = mocker.patch(
|
||||
'app.organisations_client.create_organisation'
|
||||
)
|
||||
|
||||
client_request.login(platform_admin_user)
|
||||
page = client_request.post(
|
||||
'.add_organisation',
|
||||
_data={
|
||||
'name': ".",
|
||||
'organisation_type': 'local',
|
||||
'crown_status': 'non-crown',
|
||||
},
|
||||
_expected_status=200,
|
||||
)
|
||||
assert mock_create_organisation.called is False
|
||||
assert page.find("span", {"class": "error-message"})
|
||||
|
||||
|
||||
@pytest.mark.parametrize('organisation_type, organisation, expected_status', (
|
||||
('nhs_gp', None, 200),
|
||||
('central', None, 403),
|
||||
|
||||
Reference in New Issue
Block a user