def test_return_to_final_summary_questionnaire_is_not_complete(self):
        self.schema = load_schema_from_name(
            "test_new_routing_to_questionnaire_end_multiple_sections")
        self.answer_store = AnswerStore([{
            "answer_id": "test-answer",
            "value": "Yes"
        }])
        self.progress_store = ProgressStore([{
            "section_id": "test-section",
            "list_item_id": None,
            "status": CompletionStatus.COMPLETED,
            "block_ids": ["test-forced"],
        }])

        current_location = Location(section_id="test-section",
                                    block_id="test-forced")
        routing_path = RoutingPath(["test-forced"], section_id="test-section")
        next_location = self.router.get_next_location_url(
            current_location, routing_path, return_to="final-summary")
        expected_location = Location(
            section_id="test-section-2",
            block_id="test-optional",
            list_item_id=None,
        )

        self.assertEqual(expected_location.url(), next_location)
    def test_location_url_with_list(self):
        location = Location(section_id="some-section",
                            block_id="add-block",
                            list_name="people")
        location_url = location.url()

        self.assertEqual(
            location_url,
            "http://test.localdomain/questionnaire/people/add-block/")
Esempio n. 3
0
    def test_location_url(self):
        location = Location('some-group', 0, 'some-block')

        metadata = {
            "eq_id": '1',
            "collection_exercise_sid": '999',
            "form_type": "some_form"
        }
        location_url = location.url(metadata)

        self.assertEqual(
            location_url,
            "http://test/questionnaire/1/some_form/999/some-group/0/some-block"
        )
Esempio n. 4
0
    def test_location_url(self):
        location = Location('some-group', 0, 'some-block')

        metadata = {
            'eq_id': '1',
            'collection_exercise_sid': '999',
            'form_type': 'some_form'
        }
        location_url = location.url(metadata)

        self.assertEqual(
            location_url,
            'http://test.localdomain/questionnaire/1/some_form/999/some-group/0/some-block'
        )
    def test_location_url(self):
        location = Location(section_id="some-section", block_id="some-block")
        location_url = location.url()

        self.assertEqual(location_url,
                         "http://test.localdomain/questionnaire/some-block/")