def test_jump(self):
        q_data = self._loadFixture('groups.json')

        # can't jump unless we have resume data
        resume_data = {
            'started': True,
            'completed': False,
            'index': 1,
            'history': {},
            'warningsAccepted': [],
            'justifications': {},
            'responses': {
                'EQ_start_q1': '1',  # Numeric required field
                'EQ_start_q2': None,  # Rich text text, no response required
                'EQ_start_q3': 'option1',  # Multi-choice, option 1
                'EQ_start_q4': 'option1',  # Checkbox, selected
                'EQ_start_q5': 'Some Text',  # required free text field
                'EQ_start_q6': None  # Optional numeric
            }
        }

        q_manager = QuestionnaireManager(q_data, resume_data)

        # take us to the start of the questionnaire
        q_manager.start_questionnaire()

        start = q_manager.get_current_question()

        assert isinstance(start, QuestionGroup) == True

        assert start.get_reference() == 'EQ_start'

        assert q_manager.get_current_question_index() == 1

        assert q_manager.get_total_questions() == 2

        next_question = q_manager.get_next_question(None)

        assert next_question.get_reference(
        ) == 'EQ_q1'  # automatically generated reference 'q1'

        q_manager.jump_to_question('EQ_start')

        current_question = q_manager.get_current_question()

        assert current_question.get_reference() == start.get_reference()
        assert q_manager.get_current_question_index() == 1
    def test_jump(self):
        q_data = self._loadFixture('groups.json')

        # can't jump unless we have resume data
        resume_data = {
            'started': True,
            'completed': False,
            'index': 1,
            'history': {},
            'warningsAccepted': [],
            'justifications': {},
            'responses': {
                'EQ_start_q1': '1',  # Numeric required field
                'EQ_start_q2': None,  # Rich text text, no response required
                'EQ_start_q3': 'option1',  # Multi-choice, option 1
                'EQ_start_q4': 'option1',  # Checkbox, selected
                'EQ_start_q5': 'Some Text',  # required free text field
                'EQ_start_q6': None  # Optional numeric
            }
        }

        q_manager = QuestionnaireManager(q_data, resume_data)

        # take us to the start of the questionnaire
        q_manager.start_questionnaire()

        start = q_manager.get_current_question()

        assert isinstance(start, QuestionGroup) == True

        assert start.get_reference() == 'EQ_start'

        assert q_manager.get_current_question_index() == 1

        assert q_manager.get_total_questions() == 2

        next_question = q_manager.get_next_question(None)

        assert next_question.get_reference() == 'EQ_q1'  # automatically generated reference 'q1'

        q_manager.jump_to_question('EQ_start')

        current_question = q_manager.get_current_question()

        assert current_question.get_reference() == start.get_reference()
        assert q_manager.get_current_question_index() == 1
    def test_progress(self):
        q_data = self._loadFixture('groups.json')
        resume_data = {}

        q_manager = QuestionnaireManager(q_data, resume_data)
        q_manager.start_questionnaire()

        q1 = q_manager.get_current_question()

        assert isinstance(q1, QuestionGroup) == True

        assert q_manager.get_current_question_index() == 1

        assert q_manager.get_total_questions() == 2

        q_manager.get_next_question(None)

        assert q_manager.get_current_question_index() == 2
    def test_progress(self):
        q_data = self._loadFixture('groups.json')
        resume_data = {}

        q_manager = QuestionnaireManager(q_data, resume_data)
        q_manager.start_questionnaire()

        q1 = q_manager.get_current_question()

        assert isinstance(q1, QuestionGroup) == True

        assert q_manager.get_current_question_index() == 1

        assert q_manager.get_total_questions() == 2

        q_manager.get_next_question(None)

        assert q_manager.get_current_question_index() == 2