Stop saying "areas" when we mean "area_ids"

"areas" normally means an instance of BroadcastArea or similar, so
we should be more accurate to avoid confusion.
This commit is contained in:
Ben Thorner
2021-08-26 10:42:20 +01:00
parent bdf0fdbd5f
commit de9d1f991b
5 changed files with 25 additions and 28 deletions

View File

@@ -678,7 +678,7 @@ def broadcast_message_json(
updated_at=None,
approved_by_id=None,
cancelled_by_id=None,
areas=None,
area_ids=None,
simple_polygons=None,
content=None,
reference=None,
@@ -696,7 +696,7 @@ def broadcast_message_json(
'reference': reference,
'personalisation': {},
'areas': areas or [
'areas': area_ids or [
'ctry19-E92000001', 'ctry19-S92000003',
],
'simple_polygons': simple_polygons or [],

View File

@@ -904,7 +904,7 @@ def test_preview_broadcast_areas_page(
created_by_id=fake_uuid,
service_id=SERVICE_ONE_ID,
status='draft',
areas=areas_selected,
area_ids=areas_selected,
),
)
client_request.login(active_user_create_broadcasts_permission)
@@ -974,7 +974,7 @@ def test_preview_broadcast_areas_page_with_custom_polygons(
created_by_id=fake_uuid,
service_id=SERVICE_ONE_ID,
status='draft',
areas=['Area one', 'Area two', 'Area three'],
area_ids=['Area one', 'Area two', 'Area three'],
simple_polygons=polygons,
),
)
@@ -1000,7 +1000,7 @@ def test_preview_broadcast_areas_page_with_custom_polygons(
] == expected_list_items
@pytest.mark.parametrize('areas, expected_list', (
@pytest.mark.parametrize('area_ids, expected_list', (
([], [
'Countries',
'Demo areas',
@@ -1053,7 +1053,7 @@ def test_choose_broadcast_library_page(
service_one,
fake_uuid,
active_user_create_broadcasts_permission,
areas,
area_ids,
expected_list,
):
service_one['permissions'] += ['broadcast']
@@ -1065,7 +1065,7 @@ def test_choose_broadcast_library_page(
created_by_id=fake_uuid,
service_id=SERVICE_ONE_ID,
status='draft',
areas=areas,
area_ids=area_ids,
),
)
client_request.login(active_user_create_broadcasts_permission)
@@ -1108,7 +1108,7 @@ def test_suggested_area_has_correct_link(
created_by_id=fake_uuid,
service_id=SERVICE_ONE_ID,
status='draft',
areas=[
area_ids=[
'wd20-E05004299', # Pitville, a ward of Cheltenham
],
),

View File

@@ -11,7 +11,7 @@ def test_simple_polygons(fake_uuid):
template_id=fake_uuid,
status='draft',
created_by_id=fake_uuid,
areas=[
area_ids=[
# Hackney Central
'wd20-E05009372',
# Hackney Wick
@@ -56,7 +56,7 @@ def test_raises_for_missing_areas(fake_uuid):
template_id=fake_uuid,
status='draft',
created_by_id=fake_uuid,
areas=[
area_ids=[
'wd20-E05009372',
'something else',
],