Simpify org types migration script and introduce foreign key

Don't transform org types on prod
This commit is contained in:
Pea Tyczynska
2019-07-24 16:37:23 +01:00
parent 5b256fa64e
commit 38bb2c1cf6
5 changed files with 82 additions and 96 deletions

View File

@@ -574,7 +574,7 @@ def test_update_service(client, notify_db, sample_service):
'email_from': 'updated.service.name',
'created_by': str(sample_service.created_by.id),
'email_branding': str(brand.id),
'organisation_type': 'foo',
'organisation_type': 'school_or_college',
}
auth_header = create_authorization_header()
@@ -589,7 +589,25 @@ def test_update_service(client, notify_db, sample_service):
assert result['data']['name'] == 'updated service name'
assert result['data']['email_from'] == 'updated.service.name'
assert result['data']['email_branding'] == str(brand.id)
assert result['data']['organisation_type'] == 'foo'
assert result['data']['organisation_type'] == 'school_or_college'
def test_cant_update_service_org_type_to_random_value(client, sample_service):
data = {
'name': 'updated service name',
'email_from': 'updated.service.name',
'created_by': str(sample_service.created_by.id),
'organisation_type': 'foo',
}
auth_header = create_authorization_header()
resp = client.post(
'/service/{}'.format(sample_service.id),
data=json.dumps(data),
headers=[('Content-Type', 'application/json'), auth_header]
)
assert resp.status_code == 500
def test_update_service_letter_branding(client, notify_db, sample_service):

View File

@@ -102,6 +102,7 @@ def notify_db_session(notify_db):
"provider_details_history",
"template_process_type",
"notification_status_types",
"organisation_types",
"service_permission_types",
"auth_type",
"invite_status_type",