Example #1
0
    def test_correct_questions_returned_for_page_higher_than_one(self, questions_mock):
        question21 = Question()
        question21.text = "Fake text"
        question21.category = "adm"
        question21.question_number = 21
        question22 = Question()
        question22.text = "Fake text"
        question22.category = "fai"
        question22.question_number = 22

        questions_mock.return_value = [
            question21,
            question22
        ]

        actual, _, _ = self.survey.get_survey_page(2)
        expected = [
            {"question_number": 21, "text": "Fake text", "answer": None, "category": "adm"},
            {"question_number": 22, "text": "Fake text", "answer": None, "category": "fai"}
        ]
        self.assertEqual(expected, actual)