def test_one_geography_with_gss(self): org = OrganisationFactory() geo = OrganisationGeographyFactory(organisation=org, gss='X01000001') self.assertEqual(geo, org.get_geography(date.today())) self.assertEqual(geo, org.get_geography("doesn't even need to be a date")) self.assertEqual('https://mapit.mysociety.org/area/X01000001', org.format_geography_link()) geo.gss = '' geo.save() self.assertEqual(None, org.format_geography_link())
def test_one_geography_no_gss(self): org = OrganisationFactory() geo = OrganisationGeographyFactory(organisation=org, gss='') self.assertEqual(geo, org.get_geography(date.today())) self.assertEqual(None, org.format_geography_link())
def test_no_geographies(self): org = OrganisationFactory() self.assertEqual(None, org.get_geography(date.today())) self.assertEqual(None, org.format_geography_link())