Complete migration to new "areas" API format

Depends on: https://github.com/alphagov/notifications-api/pull/3314

Previously:

- We introduced a new "areas_2" API field that's can
populate the "areas" column in the same way.

- We updated the Admin app to use the new field, so that
the old "areas" and "simple_polygons" API fields are unused.

- We repurposed the unused "areas" API field to use
the new "areas_2" format.

This PR:

- We can switch the Admin app back to the "areas" field,
but in the new format.

Future PRs:

- Remove support for the unused "areas_2" field (migration complete)
This commit is contained in:
Ben Thorner
2021-08-27 14:32:56 +01:00
parent 6c4340c5eb
commit cfdd244325
3 changed files with 11 additions and 11 deletions

View File

@@ -1395,7 +1395,7 @@ def test_add_broadcast_area(
service_id=SERVICE_ONE_ID,
broadcast_message_id=fake_uuid,
data={
'areas_2': {
'areas': {
'ids': ['ctry19-E92000001', 'ctry19-S92000003', 'ctry19-W92000004'],
'names': ['England', 'Scotland', 'Wales'],
'simple_polygons': coordinates
@@ -1459,7 +1459,7 @@ def test_add_broadcast_sub_area_district_view(
service_id=SERVICE_ONE_ID,
broadcast_message_id=fake_uuid,
data={
'areas_2': {
'areas': {
'simple_polygons': coordinates,
**expected_data,
}
@@ -1495,7 +1495,7 @@ def test_add_broadcast_sub_area_county_view(
service_id=SERVICE_ONE_ID,
broadcast_message_id=fake_uuid,
data={
'areas_2': {
'areas': {
'simple_polygons': coordinates,
'ids': [
# These two areas are on the broadcast already
@@ -1542,7 +1542,7 @@ def test_remove_broadcast_area_page(
service_id=SERVICE_ONE_ID,
broadcast_message_id=fake_uuid,
data={
'areas_2': {
'areas': {
'simple_polygons': coordinates,
'names': ['Scotland'],
'ids': ['ctry19-S92000003']