diff options
author | prathamesh | 2017-11-07 13:05:05 +0530 |
---|---|---|
committer | prathamesh | 2017-11-07 13:05:05 +0530 |
commit | 4c1ddc15f3b9a15bee49ac2f6640c8ed311f7151 (patch) | |
tree | 2a6fe1538fc4b20d17cb156e04bb7bba4e217587 /yaksh/test_models.py | |
parent | b7864df91a82d6d56d4eb76d39aae2954302669a (diff) | |
download | online_test-4c1ddc15f3b9a15bee49ac2f6640c8ed311f7151.tar.gz online_test-4c1ddc15f3b9a15bee49ac2f6640c8ed311f7151.tar.bz2 online_test-4c1ddc15f3b9a15bee49ac2f6640c8ed311f7151.zip |
Made changes as per suggestions
Diffstat (limited to 'yaksh/test_models.py')
-rw-r--r-- | yaksh/test_models.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/yaksh/test_models.py b/yaksh/test_models.py index ee698a6..ddacb2a 100644 --- a/yaksh/test_models.py +++ b/yaksh/test_models.py @@ -388,15 +388,15 @@ class QuestionPaperTestCases(unittest.TestCase): self.question_paper_fixed_questions = QuestionPaper.objects.create( quiz=self.quiz) self.question_paper_fixed_questions.fixed_questions.add( - self.questions.get(id=11), self.questions.get(id=10)) + self.questions.get(summary='Q11'), self.questions.get(summary='Q10')) # create question paper with only random questions self.question_paper_random_questions = QuestionPaper.objects.create( quiz=self.quiz) self.question_set_random = QuestionSet.objects.create(marks=2, num_questions=2) - self.question_set_random.questions.add(self.questions.get(id=13), - self.questions.get(id=5), self.questions.get(id=7)) + self.question_set_random.questions.add(self.questions.get(summary='Q13'), + self.questions.get(summary='Q5'), self.questions.get(summary='Q7')) self.question_paper_random_questions.random_questions.add( self.question_set_random) @@ -464,16 +464,16 @@ class QuestionPaperTestCases(unittest.TestCase): def test_get_question_bank(self): # Given - ids = [11, 10] - questions = list(Question.objects.filter(id__in=ids)) + summaries = ['Q11', 'Q10'] + questions = list(Question.objects.filter(summary__in=summaries)) # When question_bank = self.question_paper_fixed_questions.get_question_bank() # Then self.assertSequenceEqual(questions, question_bank) # Given - ids = [13, 5, 7] - questions = list(Question.objects.filter(id__in=ids)) + summaries = ['Q13','Q5','Q7'] + questions = list(Question.objects.filter(summary__in=summaries)) # When question_bank = self.question_paper_random_questions.get_question_bank() # Then |