Body of notification without placeholder should have been present.

This commit is contained in:
Adam Shimali
2016-06-23 10:20:49 +01:00
parent ed5bdb7be8
commit f65b86cfc9
2 changed files with 4 additions and 0 deletions

View File

@@ -272,6 +272,8 @@ class NotificationStatusSchema(BaseSchema):
if in_data['template']['template_type'] == 'email':
in_data['subject'] = template.replaced_subject
in_data.pop('personalisation', None)
else:
in_data['body'] = in_data['template']['content']
in_data['template'].pop('content', None)
in_data['template'].pop('subject', None)
return in_data

View File

@@ -35,6 +35,7 @@ def test_get_notification_by_id(notify_api, sample_notification):
assert notification['to'] == '+447700900855'
assert notification['service'] == str(sample_notification.service_id)
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):
@@ -75,6 +76,7 @@ def test_get_all_notifications(notify_api, sample_notification):
assert notifications['notifications'][0]['to'] == '+447700900855'
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