summaryrefslogtreecommitdiff
path: root/yaksh/test_models.py
diff options
context:
space:
mode:
authorPrabhu Ramachandran2018-06-07 14:23:07 +0530
committerGitHub2018-06-07 14:23:07 +0530
commit94d009bde0bdf3565cf31112a38ff3317fb80f3c (patch)
treef3af495d8c76a36a2d3e82f361c7ca433ccf5612 /yaksh/test_models.py
parentcd4a76d2bb8eb39621729536fbd9a8f2036d13cf (diff)
parentbd2672ea701fb3f6270a3e7af41cc44568f7330b (diff)
downloadonline_test-94d009bde0bdf3565cf31112a38ff3317fb80f3c.tar.gz
online_test-94d009bde0bdf3565cf31112a38ff3317fb80f3c.tar.bz2
online_test-94d009bde0bdf3565cf31112a38ff3317fb80f3c.zip
Merge pull request #461 from adityacp/fix_quiz_completion
Quiz Completion Status
Diffstat (limited to 'yaksh/test_models.py')
-rw-r--r--yaksh/test_models.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/yaksh/test_models.py b/yaksh/test_models.py
index 3bf8a00..bcd0434 100644
--- a/yaksh/test_models.py
+++ b/yaksh/test_models.py
@@ -210,10 +210,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
@@ -723,6 +724,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
@@ -1053,9 +1057,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'] = \
@@ -1726,7 +1731,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)