mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-26 01:03:41 -04:00
Add org types table
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user