Esempio n. 1
0
 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")
     )
Esempio n. 2
0
 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")
     )
Esempio n. 3
0
 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))
Esempio n. 4
0
 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))
Esempio n. 5
0
 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))
Esempio n. 6
0
 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")
     )