mirror of
https://github.com/GSA/notifications-api.git
synced 2026-07-16 11:20:41 -04:00
nhs_central is crown org and also we do not update org type while
updating service anymore.
This commit is contained in:
@@ -389,7 +389,7 @@ def test_get_all_user_services_should_return_empty_list_if_no_services_for_user(
|
||||
|
||||
@freeze_time('2019-04-23T10:00:00')
|
||||
def test_dao_fetch_live_services_data(sample_user):
|
||||
org = create_organisation(organisation_type='crown')
|
||||
org = create_organisation(organisation_type='nhs_central')
|
||||
service = create_service(go_live_user=sample_user, go_live_at='2014-04-20T10:00:00')
|
||||
template = create_template(service=service)
|
||||
service_2 = create_service(service_name='second', go_live_at='2017-04-20T10:00:00', go_live_user=sample_user)
|
||||
@@ -427,7 +427,7 @@ def test_dao_fetch_live_services_data(sample_user):
|
||||
# checks the results and that they are ordered by date:
|
||||
assert results == [
|
||||
{'service_id': mock.ANY, 'service_name': 'Sample service', 'organisation_name': 'test_org_1',
|
||||
'organisation_type': 'crown', 'consent_to_research': None, 'contact_name': 'Test User',
|
||||
'organisation_type': 'nhs_central', 'consent_to_research': None, 'contact_name': 'Test User',
|
||||
'contact_email': 'notify@digital.cabinet-office.gov.uk', 'contact_mobile': '+447700900986',
|
||||
'live_date': datetime(2014, 4, 20, 10, 0), 'sms_volume_intent': None, 'email_volume_intent': None,
|
||||
'letter_volume_intent': None, 'sms_totals': 2, 'email_totals': 1, 'letter_totals': 1,
|
||||
|
||||
@@ -696,31 +696,6 @@ def test_update_service_flags(client, sample_service):
|
||||
assert set(result['data']['permissions']) == set([LETTER_TYPE, INTERNATIONAL_SMS_TYPE])
|
||||
|
||||
|
||||
@pytest.mark.parametrize("org_type, expected",
|
||||
[("central", None),
|
||||
("local", False),
|
||||
("nhs_central", False),
|
||||
("nhs_local", False),
|
||||
("emergency_service", 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,
|
||||
}
|
||||
auth_header = create_authorization_header()
|
||||
|
||||
resp = client.post(
|
||||
'/service/{}'.format(sample_service.id),
|
||||
data=json.dumps(data),
|
||||
headers=[('Content-Type', 'application/json'), auth_header]
|
||||
)
|
||||
result = resp.json
|
||||
assert resp.status_code == 200
|
||||
assert result['data']['crown'] is expected
|
||||
|
||||
|
||||
@pytest.mark.parametrize('field', (
|
||||
'volume_email',
|
||||
'volume_sms',
|
||||
|
||||
Reference in New Issue
Block a user