def test_previous_location_with_hub_enabled(self): schema = load_schema_from_name("test_hub_and_spoke") router = Router( schema, self.answer_store, self.list_store, self.progress_store, self.metadata, ) current_location = Location(section_id="employment-section", block_id="employment-status") routing_path = RoutingPath(["employment-status", "employment-status"], section_id="employment-section") previous_location_url = router.get_previous_location_url( current_location, routing_path) expected_location_url = url_for("questionnaire.get_questionnaire") self.assertEqual(previous_location_url, expected_location_url)
def test_previous_location_url(self): schema = load_schema_from_name("test_textfield") router = Router( schema, self.answer_store, self.list_store, self.progress_store, self.metadata, ) current_location = Location(section_id="default-section", block_id="summary") routing_path = RoutingPath(["name-block", "summary"], section_id="default-section") previous_location_url = router.get_previous_location_url( current_location, routing_path) expected_location_url = Location(section_id="default-section", block_id="name-block").url() self.assertEqual(previous_location_url, expected_location_url)