Skip to content

Commit

Permalink
Remove redundant fuel poverty import
Browse files Browse the repository at this point in the history
There is a separate, more up-to-date fuel import dataset that exists in
the app, and this import isn't used. The test for this import is also
removed.
  • Loading branch information
alexander-griffen committed Nov 15, 2023
1 parent 4890321 commit eb11b1e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 82 deletions.
50 changes: 0 additions & 50 deletions hub/management/commands/import_area_fuel_poverty_data.py

This file was deleted.

32 changes: 0 additions & 32 deletions hub/tests/test_import_area_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,38 +121,6 @@ def test_import(self, patch_read_excel):
self.assertEqual(south_data[1].data_type.average, 16.1)


class ImportFuelPovertyDataTestCase(ImportTestCase):
command = "import_area_fuel_poverty_data"

@mock.patch("hub.management.commands.import_area_age_data.pd.read_excel")
def test_import(self, patch_read_excel):
data = {
"Parliamentary Constituency Code": [
"E10000001",
"E10000002",
"E40000002",
],
"Proportion of households fuel poor (%)": [12.1, 13.2, 14.2],
}
patch_read_excel.return_value = pd.DataFrame(data=data)
out = self.call_command()

self.assertEqual(out, "Failed to find area with code E40000002\n")

area_data = AreaData.objects.all()
self.assertEqual(area_data.count(), 2)

south_data = (
AreaData.objects.filter(area__gss="E10000001")
.order_by("data_type__name")
.all()
)

self.assertEqual(south_data[0].value(), 12.1)

self.assertEqual(round(south_data[0].data_type.average, 2), 12.65)


class ImportIMDTestCase(ImportTestCase):
command = "import_imd_data"

Expand Down

0 comments on commit eb11b1e

Please sign in to comment.