mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-21 07:51:13 -05:00
Updated the precompiled response to not include the template.
The template in precompiled is only used internally and cannot be accessed from the UI. It could confuse the client consumer so best to remove it from the response altogether. * Remove the template from the dict before returning it and therefore ensuring it still stays similar to letter * Updated the test to check for the response without the template
This commit is contained in:
@@ -104,6 +104,9 @@ def post_precompiled_letter_notification():
|
||||
scheduled_for=None,
|
||||
)
|
||||
|
||||
# Precompile should be the same as a letter without the template as its auto generated
|
||||
resp.pop('template', None)
|
||||
|
||||
return jsonify(resp), 201
|
||||
|
||||
|
||||
|
||||
@@ -758,16 +758,12 @@ def test_post_precompiled_letter_notification_returns_201(client, notify_user, m
|
||||
assert notification.billable_units == 3
|
||||
|
||||
resp_json = json.loads(response.get_data(as_text=True))
|
||||
|
||||
assert resp_json == {
|
||||
'content': {'body': None, 'subject': 'Pre-compiled PDF'},
|
||||
'id': str(notification.id),
|
||||
'reference': 'letter-reference',
|
||||
'scheduled_for': None,
|
||||
'template': {
|
||||
'id': ANY,
|
||||
'uri': ANY,
|
||||
'version': 1
|
||||
},
|
||||
'uri': ANY
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user