From 50db538df73047c248d98d0a532463e4d15f2f48 Mon Sep 17 00:00:00 2001 From: Ken Tsang Date: Thu, 23 Mar 2017 11:50:15 +0000 Subject: [PATCH] Updated schema to remove redundant 'content' --- app/v2/template/template_schemas.py | 2 +- tests/app/v2/template/test_post_template.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/v2/template/template_schemas.py b/app/v2/template/template_schemas.py index be0d412bd..bc405129c 100644 --- a/app/v2/template/template_schemas.py +++ b/app/v2/template/template_schemas.py @@ -73,7 +73,7 @@ def create_post_template_preview_response(template, body, url_root): "id": template.id, "type": template.template_type, "version": template.version, - "content": {'body': body}, + "body": body, "subject": template.subject, "uri": "{}v2/template/{}/preview".format(url_root, template.id) } diff --git a/tests/app/v2/template/test_post_template.py b/tests/app/v2/template/test_post_template.py index 0d2b70ccb..f99b3ee86 100644 --- a/tests/app/v2/template/test_post_template.py +++ b/tests/app/v2/template/test_post_template.py @@ -32,7 +32,7 @@ def test_valid_post_template_returns_200(client, sample_service, tmp_type): assert resp_json['id'] == str(template.id) assert 'v2/template/{}/preview'.format(template.id) in resp_json['uri'] - assert 'Dear {}'.format(valid_data['personalisation']['Name']) in resp_json['content']['body'] + assert 'Dear {}'.format(valid_data['personalisation']['Name']) in resp_json['body'] @pytest.mark.parametrize("tmp_type", TEMPLATE_TYPES)