def test_multiple_elections(self): s = Stitcher( load_fixture("test_multiple_elections", "wdiv"), load_fixture("test_multiple_elections", "wcivf"), HttpRequest(), ) self.assertDictEqual( s.make_result_known_response(), load_sandbox_output("AA14AA") )
def test_one_election_station_known_with_candidates(self): s = Stitcher( load_fixture("test_one_election_station_known_with_candidates", "wdiv"), load_fixture("test_one_election_station_known_with_candidates", "wcivf"), HttpRequest(), ) self.assertDictEqual( s.make_result_known_response(), load_sandbox_output("AA12AA") )
def test_multiple_elections(self): postcode = "AA14AA" s = Stitcher( load_fixture(fixture_map[postcode], "wdiv"), load_fixture(fixture_map[postcode], "wcivf"), self.request, ) self.assertDictEqual(s.make_result_known_response(), load_sandbox_output(postcode))
def test_address_picker(self): postcode = "AA13AA" s = Stitcher( load_fixture(fixture_map[postcode], "wdiv"), load_fixture(fixture_map[postcode], "wcivf"), self.request, ) self.assertDictEqual(s.make_address_picker_response(), load_sandbox_output(postcode))
def test_one_election_station_not_known_with_candidates(self): postcode = "AA12AB" s = Stitcher( load_fixture(fixture_map[postcode], "wdiv"), load_fixture(fixture_map[postcode], "wcivf"), self.request, ) self.assertDictEqual(s.make_result_known_response(), load_sandbox_output(postcode))
def test_address_picker(self): request = HttpRequest() request.build_absolute_uri = ( lambda route: f'https://developers.democracyclub.org.uk{route.replace("/api/v1/", "/api/v1/sandbox/")}' ) s = Stitcher( load_fixture("test_address_picker", "wdiv"), load_fixture("test_address_picker", "wcivf"), request, ) self.assertDictEqual( s.make_address_picker_response(), load_sandbox_output("AA13AA") )