Files
notifications-admin/tests/app/models/test_broadcast_message.py
Chris Hill-Scott be16c0187f Rename electoral wards to local areas
We’ve observed people using ‘national’ and ‘local’ during user research.
It has less tongue-twisting ambiguity than county vs country.

But we think that maybe just getting rid of ‘counties’ is enough to
disambiguate them. So this commit just takes the ‘local’ concept.

This commit also gives the libraries and areas new IDs, which means if
we want to rename them in the future it won’t be a breaking change.
2020-08-13 17:54:28 +01:00

31 lines
903 B
Python

from app.models.broadcast_message import BroadcastMessage
from tests import broadcast_message_json
def test_simple_polygons(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,
areas=[
# Hackney Central
'wd20-E05009372',
# Hackney Wick
'wd20-E05009374',
],
))
assert [
[len(polygon) for polygon in broadcast_message.polygons],
[len(polygon) for polygon in broadcast_message.simple_polygons],
] == [
# One polygon for each area
[27, 31],
# Because the areas are close to each other, the simplification
# and unioning process results in a single polygon with fewer
# total coordinates
[34],
]