Update service type and crown when service is added to organisation

This commit is contained in:
Pea Tyczynska
2019-07-15 14:39:21 +01:00
parent 9dfc550f46
commit 8a3ac8400f
4 changed files with 14 additions and 15 deletions

View File

@@ -132,11 +132,12 @@ def test_get_organisation_by_domain(
assert response['result'] == 'error'
def test_post_create_organisation(admin_request, notify_db_session):
@pytest.mark.parametrize('crown', [True, False, None])
def test_post_create_organisation(admin_request, notify_db_session, crown):
data = {
'name': 'test organisation',
'active': True,
'crown': False,
'crown': crown,
'organisation_type': 'local',
}
@@ -192,20 +193,14 @@ def test_post_create_organisation_existing_name_raises_400(admin_request, sample
'name': 'Service name',
'crown': True,
}, 'organisation_type is a required property'),
({
'active': False,
'name': 'Service name',
'crown': None,
'organisation_type': 'central',
}, 'crown None is not of type boolean'),
({
'active': False,
'name': 'Service name',
'crown': False,
'organisation_type': 'foo',
}, 'organisation_type foo is not one of [central, local, nhs]'),
}, 'organisation_type foo is not one of [central, local, nhs_central, nhs_local, emergency_services, school_or_college, other]'), # noqa
))
def test_post_create_organisation_with_missing_name_gives_validation_error(
def test_post_create_organisation_with_missing_data_gives_validation_error(
admin_request,
notify_db_session,
data,