diff options
author | Prabhu Ramachandran | 2018-03-21 18:19:39 +0530 |
---|---|---|
committer | GitHub | 2018-03-21 18:19:39 +0530 |
commit | 3226e8f455d51967c29171d601783ea4de88306a (patch) | |
tree | b7f5e862e9bcf34a7b07a346015c6d557e148da8 /yaksh/test_models.py | |
parent | cb6b1aad8f77035d1bfb598d8b70c51c23c435d7 (diff) | |
parent | d015f6e34d67ac71814f91f99d2bbdfa3458f3cc (diff) | |
download | online_test-3226e8f455d51967c29171d601783ea4de88306a.tar.gz online_test-3226e8f455d51967c29171d601783ea4de88306a.tar.bz2 online_test-3226e8f455d51967c29171d601783ea4de88306a.zip |
Merge pull request #450 from adityacp/change_student_dashboard
Student Dashboard Changes
Diffstat (limited to 'yaksh/test_models.py')
-rw-r--r-- | yaksh/test_models.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/yaksh/test_models.py b/yaksh/test_models.py index a0ccd49..49bba00 100644 --- a/yaksh/test_models.py +++ b/yaksh/test_models.py @@ -1676,6 +1676,24 @@ class CourseTestCases(unittest.TestCase): updated_percent = self.course.percent_completed(self.student1) self.assertEqual(updated_percent, 25) + def test_course_time_remaining_to_start(self): + # check if course has 0 days left to start + self.assertEqual(self.course.days_before_start(), 0) + + # check if course has some days left to start + course_time = self.course.start_enroll_time + self.course.start_enroll_time = datetime( + 2199, 12, 31, 10, 8, 15, 0, + tzinfo=pytz.utc + ) + self.course.save() + updated_course = Course.objects.get(id=self.course.id) + time_diff = updated_course.start_enroll_time - timezone.now() + actual_days = time_diff.days + 1 + self.assertEqual(updated_course.days_before_start(), actual_days) + self.course.start_enroll_time = course_time + self.course.save() + ############################################################################### class TestCaseTestCases(unittest.TestCase): |