mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-23 07:46:06 -04:00
Emergency service instead of emergency services
This commit is contained in:
@@ -326,9 +326,9 @@ class Domain(db.Model):
|
|||||||
|
|
||||||
ORGANISATION_TYPES = [
|
ORGANISATION_TYPES = [
|
||||||
"central", "local", "nhs_central",
|
"central", "local", "nhs_central",
|
||||||
"nhs_local", "emergency_services", "school_or_college", "other",
|
"nhs_local", "emergency_service", "school_or_college", "other",
|
||||||
]
|
]
|
||||||
NON_CROWN_ORGANISATION_TYPES = ["local", "nhs_central", "nhs_local", "emergency_services", "school_or_college"]
|
NON_CROWN_ORGANISATION_TYPES = ["local", "nhs_central", "nhs_local", "emergency_service", "school_or_college"]
|
||||||
|
|
||||||
|
|
||||||
class OrganisationTypes(db.Model):
|
class OrganisationTypes(db.Model):
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ post_create_organisation_schema = {
|
|||||||
"properties": {
|
"properties": {
|
||||||
"name": {"type": "string"},
|
"name": {"type": "string"},
|
||||||
"active": {"type": ["boolean", "null"]},
|
"active": {"type": ["boolean", "null"]},
|
||||||
"crown": {"type": ["boolean", "null"]},
|
"crown": {"type": "boolean"},
|
||||||
"organisation_type": {"enum": ORGANISATION_TYPES},
|
"organisation_type": {"enum": ORGANISATION_TYPES},
|
||||||
},
|
},
|
||||||
"required": ["name", "crown", "organisation_type"]
|
"required": ["name", "crown", "organisation_type"]
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ def upgrade():
|
|||||||
["local", False, 25000],
|
["local", False, 25000],
|
||||||
["nhs_central", False, 250000],
|
["nhs_central", False, 250000],
|
||||||
["nhs_local", False, 25000],
|
["nhs_local", False, 25000],
|
||||||
["emergency_services", False, 25000],
|
["emergency_service", False, 25000],
|
||||||
["school_or_college", False, 25000],
|
["school_or_college", False, 25000],
|
||||||
["other", None, 25000],
|
["other", None, 25000],
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ def test_get_organisation_by_domain(
|
|||||||
assert response['result'] == 'error'
|
assert response['result'] == 'error'
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('crown', [True, False, None])
|
@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, crown):
|
||||||
data = {
|
data = {
|
||||||
'name': 'test organisation',
|
'name': 'test organisation',
|
||||||
@@ -193,12 +193,18 @@ def test_post_create_organisation_existing_name_raises_400(admin_request, sample
|
|||||||
'name': 'Service name',
|
'name': 'Service name',
|
||||||
'crown': True,
|
'crown': True,
|
||||||
}, 'organisation_type is a required property'),
|
}, '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,
|
'active': False,
|
||||||
'name': 'Service name',
|
'name': 'Service name',
|
||||||
'crown': False,
|
'crown': False,
|
||||||
'organisation_type': 'foo',
|
'organisation_type': 'foo',
|
||||||
}, 'organisation_type foo is not one of [central, local, nhs_central, nhs_local, emergency_services, school_or_college, other]'), # noqa
|
}, 'organisation_type foo is not one of [central, local, nhs_central, nhs_local, emergency_service, school_or_college, other]'), # noqa
|
||||||
))
|
))
|
||||||
def test_post_create_organisation_with_missing_data_gives_validation_error(
|
def test_post_create_organisation_with_missing_data_gives_validation_error(
|
||||||
admin_request,
|
admin_request,
|
||||||
|
|||||||
@@ -701,7 +701,7 @@ def test_update_service_flags(client, sample_service):
|
|||||||
("local", False),
|
("local", False),
|
||||||
("nhs_central", False),
|
("nhs_central", False),
|
||||||
("nhs_local", False),
|
("nhs_local", False),
|
||||||
("emergency_services", False),
|
("emergency_service", False),
|
||||||
("school_or_college", False),
|
("school_or_college", False),
|
||||||
("other", None)])
|
("other", None)])
|
||||||
def test_update_service_sets_crown_based_on_org_type(client, sample_service, org_type, expected):
|
def test_update_service_sets_crown_based_on_org_type(client, sample_service, org_type, expected):
|
||||||
|
|||||||
Reference in New Issue
Block a user