Switch "areas" field to "areas_2" format

The Admin app is now temporarily using the "areas_2" field while
we migrate "areas" to the new format [1].

[1]: https://github.com/alphagov/notifications-admin/pull/4004
This commit is contained in:
Ben Thorner
2021-08-27 13:22:54 +01:00
parent a7d92b9058
commit ec1171f85c
8 changed files with 49 additions and 66 deletions

View File

@@ -84,10 +84,10 @@ def test_valid_post_cap_xml_broadcast_returns_201(
assert response_json['approved_at'] is None
assert response_json['approved_by_id'] is None
# TEMPORARY: while we repurpose "areas"
assert response_json['areas'] == [
assert response_json['areas']['names'] == [
'River Steeping in Wainfleet All Saints'
]
# TEMPORARY: while we repurpose "areas"
assert response_json['areas_2']['names'] == [
'River Steeping in Wainfleet All Saints'
]
@@ -108,11 +108,11 @@ def test_valid_post_cap_xml_broadcast_returns_201(
assert response_json['service_id'] == str(sample_broadcast_service.id)
# TEMPORARY: while we repurpose "areas"
assert len(response_json['simple_polygons']) == 1
assert len(response_json['simple_polygons'][0]) == 23
assert response_json['simple_polygons'][0][0] == [53.10562, 0.244127]
assert response_json['simple_polygons'][0][-1] == [53.10562, 0.244127]
assert response_json['simple_polygons'][0][-1] == [53.10562, 0.244127]
assert len(response_json['areas']['simple_polygons']) == 1
assert len(response_json['areas']['simple_polygons'][0]) == 23
assert response_json['areas']['simple_polygons'][0][0] == [53.10562, 0.244127]
assert response_json['areas']['simple_polygons'][0][-1] == [53.10562, 0.244127]
assert response_json['areas']['simple_polygons'][0][-1] == [53.10562, 0.244127]
assert len(response_json['areas_2']['simple_polygons']) == 1
assert len(response_json['areas_2']['simple_polygons'][0]) == 23
assert response_json['areas_2']['simple_polygons'][0][0] == [53.10562, 0.244127]