diff --git a/app/models/broadcast_message.py b/app/models/broadcast_message.py index c5951b152..27106be8e 100644 --- a/app/models/broadcast_message.py +++ b/app/models/broadcast_message.py @@ -24,6 +24,7 @@ class BroadcastMessage(JSONModel): 'template_id', 'template_name', 'template_version', + 'content', 'service_id', 'created_by', 'personalisation', diff --git a/tests/__init__.py b/tests/__init__.py index 7fe6663f1..77db0dd93 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -650,6 +650,7 @@ def broadcast_message_json( approved_by_id=None, cancelled_by_id=None, areas=None, + content=None, ): return { 'id': id_, @@ -659,6 +660,7 @@ def broadcast_message_json( 'template_id': template_id, 'template_version': 123, 'template_name': 'Example template', + 'content': 'This is a test', 'personalisation': {}, 'areas': areas or [ diff --git a/tests/app/models/test_broadcast_message.py b/tests/app/models/test_broadcast_message.py index 955fac511..1b9a46124 100644 --- a/tests/app/models/test_broadcast_message.py +++ b/tests/app/models/test_broadcast_message.py @@ -34,3 +34,14 @@ def test_simple_polygons(fake_uuid): # total coordinates [51], ] + + +def test_content_comes_from_attribute_not_template(fake_uuid): + broadcast_message = BroadcastMessage(broadcast_message_json( + id_=fake_uuid, + service_id=fake_uuid, + template_id=fake_uuid, + status='draft', + created_by_id=fake_uuid, + )) + assert broadcast_message.content == 'This is a test'