mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-09 11:29:49 -04:00
Recognise that broadcast messages include content
The content attribute needs to be added to the model so we can use it later.
This commit is contained in:
@@ -24,6 +24,7 @@ class BroadcastMessage(JSONModel):
|
|||||||
'template_id',
|
'template_id',
|
||||||
'template_name',
|
'template_name',
|
||||||
'template_version',
|
'template_version',
|
||||||
|
'content',
|
||||||
'service_id',
|
'service_id',
|
||||||
'created_by',
|
'created_by',
|
||||||
'personalisation',
|
'personalisation',
|
||||||
|
|||||||
@@ -650,6 +650,7 @@ def broadcast_message_json(
|
|||||||
approved_by_id=None,
|
approved_by_id=None,
|
||||||
cancelled_by_id=None,
|
cancelled_by_id=None,
|
||||||
areas=None,
|
areas=None,
|
||||||
|
content=None,
|
||||||
):
|
):
|
||||||
return {
|
return {
|
||||||
'id': id_,
|
'id': id_,
|
||||||
@@ -659,6 +660,7 @@ def broadcast_message_json(
|
|||||||
'template_id': template_id,
|
'template_id': template_id,
|
||||||
'template_version': 123,
|
'template_version': 123,
|
||||||
'template_name': 'Example template',
|
'template_name': 'Example template',
|
||||||
|
'content': 'This is a test',
|
||||||
|
|
||||||
'personalisation': {},
|
'personalisation': {},
|
||||||
'areas': areas or [
|
'areas': areas or [
|
||||||
|
|||||||
@@ -34,3 +34,14 @@ def test_simple_polygons(fake_uuid):
|
|||||||
# total coordinates
|
# total coordinates
|
||||||
[51],
|
[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'
|
||||||
|
|||||||
Reference in New Issue
Block a user