mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-20 22:39:43 -04:00
Body of notification without placeholder should have been present.
This commit is contained in:
@@ -272,6 +272,8 @@ class NotificationStatusSchema(BaseSchema):
|
|||||||
if in_data['template']['template_type'] == 'email':
|
if in_data['template']['template_type'] == 'email':
|
||||||
in_data['subject'] = template.replaced_subject
|
in_data['subject'] = template.replaced_subject
|
||||||
in_data.pop('personalisation', None)
|
in_data.pop('personalisation', None)
|
||||||
|
else:
|
||||||
|
in_data['body'] = in_data['template']['content']
|
||||||
in_data['template'].pop('content', None)
|
in_data['template'].pop('content', None)
|
||||||
in_data['template'].pop('subject', None)
|
in_data['template'].pop('subject', None)
|
||||||
return in_data
|
return in_data
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ def test_get_notification_by_id(notify_api, sample_notification):
|
|||||||
assert notification['to'] == '+447700900855'
|
assert notification['to'] == '+447700900855'
|
||||||
assert notification['service'] == str(sample_notification.service_id)
|
assert notification['service'] == str(sample_notification.service_id)
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
|
assert notification['body'] == "This is a template" # sample_template.content
|
||||||
|
|
||||||
|
|
||||||
def test_get_notifications_empty_result(notify_api, sample_api_key):
|
def test_get_notifications_empty_result(notify_api, sample_api_key):
|
||||||
@@ -75,6 +76,7 @@ def test_get_all_notifications(notify_api, sample_notification):
|
|||||||
|
|
||||||
assert notifications['notifications'][0]['to'] == '+447700900855'
|
assert notifications['notifications'][0]['to'] == '+447700900855'
|
||||||
assert notifications['notifications'][0]['service'] == str(sample_notification.service_id)
|
assert notifications['notifications'][0]['service'] == str(sample_notification.service_id)
|
||||||
|
assert notifications['notifications'][0]['body'] == "This is a template" # sample_template.content
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user