From 98a69684c540eb696fe088381025280ca9fc846a Mon Sep 17 00:00:00 2001 From: Katie Smith Date: Wed, 10 Jun 2020 16:57:19 +0100 Subject: [PATCH] Update get_template_by_id_response & post_template_preview_response schemas To check the format of postage. Neither of these two schemas are used for validating - they seem to be added for reference. --- app/v2/template/template_schemas.py | 4 ++-- tests/app/v2/template/test_template_schemas.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/v2/template/template_schemas.py b/app/v2/template/template_schemas.py index 378eb8121..47b1bcb99 100644 --- a/app/v2/template/template_schemas.py +++ b/app/v2/template/template_schemas.py @@ -37,7 +37,7 @@ get_template_by_id_response = { "body": {"type": "string"}, "subject": {"type": ["string", "null"]}, "name": {"type": "string"}, - "postage": {"type": "string"} + "postage": {"type": "string", "format": "postage"} }, "required": ["id", "type", "created_at", "updated_at", "version", "created_by", "body", "name"], } @@ -65,7 +65,7 @@ post_template_preview_response = { "version": {"type": "integer"}, "body": {"type": "string"}, "subject": {"type": ["string", "null"]}, - "postage": {"type": "string"}, + "postage": {"type": "string", "format": "postage"}, "html": {"type": ["string", "null"]}, }, "required": ["id", "type", "version", "body"], diff --git a/tests/app/v2/template/test_template_schemas.py b/tests/app/v2/template/test_template_schemas.py index de84ad661..1ac8a0cbc 100644 --- a/tests/app/v2/template/test_template_schemas.py +++ b/tests/app/v2/template/test_template_schemas.py @@ -35,6 +35,7 @@ valid_json_get_response_with_optionals = { 'body': 'some body', 'subject': "some subject", 'name': 'some name', + 'postage': 'first', } valid_request_args = [{"id": str(uuid.uuid4()), "version": 1}, {"id": str(uuid.uuid4())}] @@ -80,6 +81,7 @@ valid_json_post_response_with_optionals = { 'version': 1, 'body': "some body", 'subject': 'some subject', + 'postage': 'second', 'html': '

some body

', }