Add preview endpoint and tests

This commit is contained in:
Ken Tsang
2017-03-22 10:09:14 +00:00
parent fbcea9c777
commit b81d789307
4 changed files with 144 additions and 7 deletions

View File

@@ -66,3 +66,14 @@ post_template_preview_response = {
},
"required": ["id", "type", "version", "body"]
}
def create_post_template_preview_response(template, body, url_root):
return {
"id": template.id,
"type": template.template_type,
"version": template.version,
"content": {'body': body},
"subject": template.subject,
"uri": "{}v2/template/{}/preview".format(url_root, template.id)
}