diff options
Diffstat (limited to 'yaksh/test_views.py')
-rw-r--r-- | yaksh/test_views.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/yaksh/test_views.py b/yaksh/test_views.py index 3b27338..8fa4747 100644 --- a/yaksh/test_views.py +++ b/yaksh/test_views.py @@ -4156,6 +4156,13 @@ class TestQuestionPaper(TestCase): ) self.float_based_testcase.save() + # Question with tag + self.tagged_que = Question.objects.create( + summary="Test_tag_question", description="Test Tag", + points=1.0, language="python", type="float", user=self.teacher + ) + self.tagged_que.tags.add("test_tag") + self.questions_list = [self.question_mcq, self.question_mcc, self.question_int, self.question_str, self.question_float] @@ -4510,6 +4517,16 @@ class TestQuestionPaper(TestCase): self.questions_list) self.assertEqual(response.context['qpaper'], self.question_paper) + # Get questions using tags for question paper + search_tag = [tag for tag in self.tagged_que.tags.all()] + response = self.client.post( + reverse('yaksh:designquestionpaper', + kwargs={"quiz_id": self.quiz.id, + "course_id": self.course.id, + "questionpaper_id": self.question_paper.id}), + data={"question_tags": search_tag}) + self.assertEqual(response.context["questions"][0], self.tagged_que) + class TestLearningModule(TestCase): def setUp(self): |