mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-16 20:48:37 -04:00
Simpify org types migration script and introduce foreign key
Don't transform org types on prod
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user