Add org types table

This commit is contained in:
Pea Tyczynska
2019-07-10 18:17:33 +01:00
parent 663ab6d96b
commit 9dfc550f46
9 changed files with 93 additions and 15 deletions

View File

@@ -176,7 +176,8 @@ def sample_service(
'message_limit': limit,
'restricted': restricted,
'email_from': email_from,
'created_by': user
'created_by': user,
'crown': True
}
service = Service.query.filter_by(name=service_name).first()
if not service:

View File

@@ -105,7 +105,7 @@ def test_create_service(notify_db_session):
assert service.active is True
assert user in service_db.users
assert service_db.organisation_type == 'central'
assert service_db.crown is True
assert service_db.crown is None
assert not service.letter_branding

View File

@@ -107,7 +107,8 @@ def create_service(
organisation_type='central',
check_if_service_exists=False,
go_live_user=None,
go_live_at=None
go_live_at=None,
crown=True
):
if check_if_service_exists:
service = Service.query.filter_by(name=service_name).first()
@@ -121,7 +122,8 @@ def create_service(
prefix_sms=prefix_sms,
organisation_type=organisation_type,
go_live_user=go_live_user,
go_live_at=go_live_at
go_live_at=go_live_at,
crown=crown
)
dao_create_service(service, service.created_by, service_id, service_permissions=service_permissions)

View File

@@ -697,10 +697,15 @@ def test_update_service_flags(client, sample_service):
@pytest.mark.parametrize("org_type, expected",
[("central", True),
('local', False),
("nhs", False)])
def test_update_service_sets_crown(client, sample_service, org_type, expected):
[("central", None),
("local", False),
("nhs_central", False),
("nhs_local", False),
("emergency_services", False),
("school_or_college", False),
("other", None)])
def test_update_service_sets_crown_based_on_org_type(client, sample_service, org_type, expected):
sample_service.crown = None
data = {
'organisation_type': org_type,
}