remove crown stuff

This commit is contained in:
stvnrlly
2022-10-17 20:16:39 +00:00
parent 59732ce137
commit 3fff0fdd84
22 changed files with 168 additions and 195 deletions

View File

@@ -68,7 +68,6 @@ def test_get_organisation_by_id(admin_request, notify_db_session):
'id',
'name',
'active',
'crown',
'organisation_type',
'agreement_signed',
'agreement_signed_at',
@@ -90,7 +89,6 @@ def test_get_organisation_by_id(admin_request, notify_db_session):
assert response['id'] == str(org.id)
assert response['name'] == 'test_org_1'
assert response['active'] is True
assert response['crown'] is None
assert response['organisation_type'] is None
assert response['agreement_signed'] is None
assert response['agreement_signed_by_id'] is None
@@ -163,12 +161,10 @@ def test_get_organisation_by_domain(
assert response['result'] == 'error'
@pytest.mark.parametrize('crown', [True, False])
def test_post_create_organisation(admin_request, notify_db_session, crown):
def test_post_create_organisation(admin_request, notify_db_session):
data = {
'name': 'test organisation',
'active': True,
'crown': crown,
'organisation_type': 'state',
}
@@ -182,7 +178,6 @@ def test_post_create_organisation(admin_request, notify_db_session, crown):
assert data['name'] == response['name']
assert data['active'] == response['active']
assert data['crown'] == response['crown']
assert data['organisation_type'] == response['organisation_type']
assert len(organisations) == 1
@@ -198,7 +193,6 @@ def test_post_create_organisation_sets_default_nhs_branding_for_nhs_orgs(
data = {
'name': 'test organisation',
'active': True,
'crown': False,
'organisation_type': org_type,
}
@@ -218,7 +212,6 @@ def test_post_create_organisation_existing_name_raises_400(admin_request, sample
data = {
'name': sample_organisation.name,
'active': True,
'crown': True,
'organisation_type': 'federal',
}
@@ -237,29 +230,15 @@ def test_post_create_organisation_existing_name_raises_400(admin_request, sample
@pytest.mark.parametrize('data, expected_error', (
({
'active': False,
'crown': True,
'organisation_type': 'federal',
}, 'name is a required property'),
({
'active': False,
'name': 'Service name',
'organisation_type': 'federal',
}, 'crown is a required property'),
({
'active': False,
'name': 'Service name',
'crown': True,
}, 'organisation_type is a required property'),
({
'active': False,
'name': 'Service name',
'crown': None,
'organisation_type': 'federal',
}, 'crown None is not of type boolean'),
({
'active': False,
'name': 'Service name',
'crown': False,
'organisation_type': 'foo',
}, (
'organisation_type foo is not one of '
@@ -283,22 +262,16 @@ def test_post_create_organisation_with_missing_data_gives_validation_error(
assert response['errors'][0]['message'] == expected_error
@pytest.mark.parametrize('crown', (
None, True, False
))
def test_post_update_organisation_updates_fields(
admin_request,
notify_db_session,
crown,
):
org = create_organisation()
data = {
'name': 'new organisation name',
'active': False,
'crown': crown,
'organisation_type': 'federal',
}
assert org.crown is None
admin_request.post(
'organisation.update_organisation',
@@ -313,7 +286,6 @@ def test_post_update_organisation_updates_fields(
assert organisation[0].id == org.id
assert organisation[0].name == data['name']
assert organisation[0].active == data['active']
assert organisation[0].crown == crown
assert organisation[0].domains == []
assert organisation[0].organisation_type == 'federal'
@@ -358,7 +330,7 @@ def test_update_other_organisation_attributes_doesnt_clear_domains(
admin_request.post(
'organisation.update_organisation',
_data={
'crown': True,
'name': 'test_org_22',
},
organisation_id=org.id,
_expected_status=204