summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradityacp2018-04-04 15:53:49 +0530
committeradityacp2018-04-04 15:53:49 +0530
commit458134e4d110be451ed7e7c5f001c2d204e1e892 (patch)
tree9ec9f0463434b47ac7b62ae8e8f8bd0bb4c5d5c0
parent7454eed485e24bbd8917aa67d2283f03f1209f51 (diff)
downloadonline_test-458134e4d110be451ed7e7c5f001c2d204e1e892.tar.gz
online_test-458134e4d110be451ed7e7c5f001c2d204e1e892.tar.bz2
online_test-458134e4d110be451ed7e7c5f001c2d204e1e892.zip
Change models test to get course completion percentage
-rw-r--r--yaksh/test_models.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/yaksh/test_models.py b/yaksh/test_models.py
index 41730c3..4cea419 100644
--- a/yaksh/test_models.py
+++ b/yaksh/test_models.py
@@ -1667,11 +1667,12 @@ class CourseTestCases(unittest.TestCase):
# for course with no modules
self.no_module_course = Course.objects.create(
name="test_course", creator=self.creator, enrollment="open")
- percent = self.course.percent_completed(self.student1)
+ modules = self.course.get_learning_modules()
+ percent = self.course.percent_completed(self.student1, modules)
self.assertEqual(percent, 0)
# for course with module but zero percent completed
- percent = self.course.percent_completed(self.student1)
+ percent = self.course.percent_completed(self.student1, modules)
self.assertEqual(percent, 0)
# Add completed unit to course status and check percent
@@ -1681,7 +1682,7 @@ class CourseTestCases(unittest.TestCase):
course_status = CourseStatus.objects.create(
course=self.course, user=self.student1)
course_status.completed_units.add(self.completed_unit)
- updated_percent = self.course.percent_completed(self.student1)
+ updated_percent = self.course.percent_completed(self.student1, modules)
self.assertEqual(updated_percent, 25)
def test_course_time_remaining_to_start(self):