Skip to content

Commit

Permalink
fixup! Update import scripts to handle 2010 constituencies again
Browse files Browse the repository at this point in the history
  • Loading branch information
zarino committed Nov 18, 2024
1 parent b642030 commit 5854b99
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion hub/tests/test_import_areas.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


def mock_areas_of_type(types, generation=None):
if "WMC" in types:
if "WMC" in types and generation is None:
return [
{
"id": 1,
Expand Down Expand Up @@ -43,6 +43,14 @@ def test_import(self, mapit_geom, mapit_areas):

call_command("import_areas", quiet=self.quiet_parameter)

expected_calls = [
mock.call(["WMC"], generation=54), # pre-2024 constituencies
mock.call(["WMC"], generation=None), # 2025 constituencies
mock.call(["LBO", "UTA", "COI", "LGD", "CTY", "MTD"], generation=None), # Single Tier councils
mock.call(["DIS", "NMD"], generation=None), # District councils
]
self.assertEqual(mapit_areas.call_args_list, expected_calls)

areas = Area.objects.all()
self.assertEqual(areas.count(), 2)

Expand Down

0 comments on commit 5854b99

Please sign in to comment.