Add TemplateHistory.get_link method

Notifications.serialize calls `Notifications.template.get_link`, so
we need TemplateHistory objects to generate their API URLs.

This generates a link to the `/v2/` version of the endpoint.
This commit is contained in:
Alexey Bezhan
2017-11-09 14:48:27 +00:00
parent c62f2a3f7c
commit 79d417f13b
2 changed files with 9 additions and 1 deletions

View File

@@ -335,7 +335,7 @@ def test_get_all_notifications_filter_by_template_type(client):
assert json_response['notifications'][0]['status'] == "created"
assert json_response['notifications'][0]['template'] == {
'id': str(email_template.id),
'uri': email_template.get_link(),
'uri': notification.template.get_link(),
'version': 1
}
assert json_response['notifications'][0]['email_address'] == "don.draper@scdp.biz"