mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
add organisation and branding to GET /service response dict
This commit is contained in:
@@ -103,6 +103,8 @@ class ProviderDetailsSchema(BaseSchema):
|
|||||||
class ServiceSchema(BaseSchema):
|
class ServiceSchema(BaseSchema):
|
||||||
|
|
||||||
created_by = field_for(models.Service, 'created_by', required=True)
|
created_by = field_for(models.Service, 'created_by', required=True)
|
||||||
|
organisation = field_for(models.Service, 'organisation_id', dump_only=True)
|
||||||
|
branding = field_for(models.Service, 'branding')
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = models.Service
|
model = models.Service
|
||||||
@@ -114,8 +116,7 @@ class ServiceSchema(BaseSchema):
|
|||||||
'old_id',
|
'old_id',
|
||||||
'template_statistics',
|
'template_statistics',
|
||||||
'service_provider_stats',
|
'service_provider_stats',
|
||||||
'service_notification_stats',
|
'service_notification_stats')
|
||||||
'organisation')
|
|
||||||
strict = True
|
strict = True
|
||||||
|
|
||||||
@validates('sms_sender')
|
@validates('sms_sender')
|
||||||
|
|||||||
@@ -108,6 +108,8 @@ def test_get_service_by_id(notify_api, sample_service):
|
|||||||
assert json_resp['data']['name'] == sample_service.name
|
assert json_resp['data']['name'] == sample_service.name
|
||||||
assert json_resp['data']['id'] == str(sample_service.id)
|
assert json_resp['data']['id'] == str(sample_service.id)
|
||||||
assert not json_resp['data']['research_mode']
|
assert not json_resp['data']['research_mode']
|
||||||
|
assert json_resp['data']['organisation'] is None
|
||||||
|
assert json_resp['data']['branding'] == 'govuk'
|
||||||
|
|
||||||
|
|
||||||
def test_get_service_by_id_should_404_if_no_service(notify_api, notify_db):
|
def test_get_service_by_id_should_404_if_no_service(notify_api, notify_db):
|
||||||
|
|||||||
Reference in New Issue
Block a user