broadcasts: test helper uses areas from message

instead of looking at "transmitted_areas" argument in the
create_broadcast_event, we should use the areas from the broadcast
message

we should be explicit in our tests about which areas we are sending, the
tests were implicitly using the default, rather than the areas from the
broadcast message which was confusing

Signed-off-by: Toby Lorne <toby.lornewelch-richards@digital.cabinet-office.gov.uk>
Co-authored-by: Richard <richard.baker@digital.cabinet-office.gov.uk>
Co-authored-by: David <david.mcdonald@digital.cabinet-office.gov.uk>
This commit is contained in:
Toby Lorne
2020-10-26 15:14:26 +00:00
parent 902a2dde94
commit ca2bea8ae6
2 changed files with 52 additions and 10 deletions

View File

@@ -1042,9 +1042,7 @@ def create_broadcast_event(
sent_at=sent_at or datetime.utcnow(),
message_type=message_type,
transmitted_content=transmitted_content or {'body': 'this is an emergency broadcast message'},
transmitted_areas=transmitted_areas or {
'areas': ['london'], 'simple_polygons': [[[50.12, 1.2], [50.13, 1.2], [50.14, 1.21]]]
},
transmitted_areas=transmitted_areas or broadcast_message.areas,
transmitted_sender=transmitted_sender or 'www.notifications.service.gov.uk',
transmitted_starts_at=transmitted_starts_at,
transmitted_finishes_at=transmitted_finishes_at or datetime.utcnow(),