mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-21 07:51:13 -05:00
Removed URI from preview response
This commit is contained in:
@@ -29,8 +29,7 @@ def post_template_preview(template_id):
|
|||||||
check_placeholders(template_object)
|
check_placeholders(template_object)
|
||||||
|
|
||||||
resp = create_post_template_preview_response(template=template,
|
resp = create_post_template_preview_response(template=template,
|
||||||
body=str(template_object),
|
body=str(template_object))
|
||||||
url_root=request.url_root)
|
|
||||||
|
|
||||||
return jsonify(resp), 200
|
return jsonify(resp), 200
|
||||||
|
|
||||||
|
|||||||
@@ -68,12 +68,11 @@ post_template_preview_response = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def create_post_template_preview_response(template, body, url_root):
|
def create_post_template_preview_response(template, body):
|
||||||
return {
|
return {
|
||||||
"id": template.id,
|
"id": template.id,
|
||||||
"type": template.template_type,
|
"type": template.template_type,
|
||||||
"version": template.version,
|
"version": template.version,
|
||||||
"body": body,
|
"body": body,
|
||||||
"subject": template.subject,
|
"subject": template.subject
|
||||||
"uri": "{}v2/template/{}/preview".format(url_root, template.id)
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ def test_valid_post_template_returns_200(client, sample_service, tmp_type):
|
|||||||
resp_json = json.loads(response.get_data(as_text=True))
|
resp_json = json.loads(response.get_data(as_text=True))
|
||||||
|
|
||||||
assert resp_json['id'] == str(template.id)
|
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['body']
|
assert 'Dear {}'.format(valid_data['personalisation']['Name']) in resp_json['body']
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user