diff options
author | adityacp | 2018-03-21 12:00:27 +0530 |
---|---|---|
committer | adityacp | 2018-03-21 12:08:32 +0530 |
commit | e244cd285669d3de80a764d75eecbb46b6d3fd63 (patch) | |
tree | 5370c89ef73fccac5ed575ecb287316ab390a7c2 /yaksh/test_models.py | |
parent | 06abd01fd28eb10aafd18dd60b790549e0233edc (diff) | |
download | online_test-e244cd285669d3de80a764d75eecbb46b6d3fd63.tar.gz online_test-e244cd285669d3de80a764d75eecbb46b6d3fd63.tar.bz2 online_test-e244cd285669d3de80a764d75eecbb46b6d3fd63.zip |
Add condition to get quiz status if answerpaper is created
Diffstat (limited to 'yaksh/test_models.py')
-rw-r--r-- | yaksh/test_models.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/yaksh/test_models.py b/yaksh/test_models.py index cd4279b..e406e53 100644 --- a/yaksh/test_models.py +++ b/yaksh/test_models.py @@ -209,10 +209,11 @@ class LearningModuleTestCases(unittest.TestCase): # Given module_status = 'not attempted' # When + self.learning_module.learning_unit.remove(self.learning_unit_two) status = self.learning_module.get_status(self.student, self.course) # Then self.assertEqual(status, module_status) - + self.learning_module.learning_unit.add(self.learning_unit_two) # Module in progress # Given @@ -706,6 +707,9 @@ class QuestionPaperTestCases(unittest.TestCase): self.trial_course = Course.objects.create_trial_course(self.user) self.trial_quiz = Quiz.objects.create_trial_quiz(self.user) + @classmethod + def tearDownClass(self): + self.quiz.questionpaper_set.all().delete() def test_get_question_bank(self): # Given @@ -991,9 +995,10 @@ class AnswerPaperTestCases(unittest.TestCase): self.server_pool = server_pool self.server_thread = t = Thread(target=server_pool.run) t.start() - + @classmethod def tearDownClass(self): + self.quiz.questionpaper_set.all().delete() self.server_pool.stop() self.server_thread.join() settings.code_evaluators['python']['standardtestcase'] = \ @@ -1650,7 +1655,7 @@ class CourseTestCases(unittest.TestCase): name="test_course", creator=self.creator, enrollment="open") percent = self.course.percent_completed(self.student1) self.assertEqual(percent, 0) - + self.quiz1.questionpaper_set.all().delete() # for course with module but zero percent completed percent = self.course.percent_completed(self.student1) self.assertEqual(percent, 0) |