Return template name in public API

The use for the public template API is for building caseworking systems
or similar, where you might need a list of templates to pick from (ie
instead of using the Notify web interface to pick from and send a
message).

Right now our API isn’t returning the template name as part of the
response. The name is a useful, human-friendly way of identifying a
template.

This commit changes the response to include the name.

Some clients will need updating before this can be useful.
This commit is contained in:
Chris Hill-Scott
2017-08-15 14:46:30 +01:00
parent 7879bc0e7e
commit 04e41e3147
5 changed files with 57 additions and 25 deletions
@@ -21,7 +21,8 @@ valid_json_get_response = {
'updated_at': None,
'version': 1,
'created_by': 'someone@test.com',
'body': 'some body'
'body': 'some body',
'name': 'some name',
}
valid_json_get_response_with_optionals = {
@@ -32,7 +33,8 @@ valid_json_get_response_with_optionals = {
'version': 1,
'created_by': 'someone',
'body': 'some body',
'subject': "some subject"
'subject': "some subject",
'name': 'some name',
}
valid_request_args = [{"id": str(uuid.uuid4()), "version": 1}, {"id": str(uuid.uuid4())}]