diff options
author | ankitjavalkar | 2017-03-30 18:10:09 +0530 |
---|---|---|
committer | ankitjavalkar | 2017-03-31 11:24:06 +0530 |
commit | 171a82aa3ef07fc9344c8c5b42542bec0a3ca5ab (patch) | |
tree | 5180d1920b1d936aeeadb3f07760d4d4db08e0d6 /yaksh/test_models.py | |
parent | 734ad94d177be8ad400eb6f97e98612ce099e56a (diff) | |
download | online_test-171a82aa3ef07fc9344c8c5b42542bec0a3ca5ab.tar.gz online_test-171a82aa3ef07fc9344c8c5b42542bec0a3ca5ab.tar.bz2 online_test-171a82aa3ef07fc9344c8c5b42542bec0a3ca5ab.zip |
Multiple changes to Course:
- Allow a start and end time for Course enrollment
- Allow Course to be editable
Diffstat (limited to 'yaksh/test_models.py')
-rw-r--r-- | yaksh/test_models.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/yaksh/test_models.py b/yaksh/test_models.py index f8f506a..7e14ce7 100644 --- a/yaksh/test_models.py +++ b/yaksh/test_models.py @@ -843,6 +843,29 @@ class CourseTestCases(unittest.TestCase): self.quiz1 = Quiz.objects.get(description='demo quiz 1') self.quiz2 = Quiz.objects.get(description='demo quiz 2') + # create courses with + self.enroll_request_course = Course.objects.create( + name="Enrollment Request Course With Enrollment Disabled", + enrollment="Enroll Request", + creator=self.creator, + start_enroll_time=datetime(2015, 10, 9, 10, 8, 15, 0, + tzinfo=pytz.utc + ), + end_enroll_time=datetime(2015, 11, 9, 10, 8, 15, 0, + tzinfo=pytz.utc + ), + ) + self.open_course = Course.objects.create( + name="Open Course With Enrollment Disabled", + enrollment="Open Course", + creator=self.creator, + start_enroll_time=datetime(2015, 10, 9, 10, 8, 15, 0, + tzinfo=pytz.utc + ), + end_enroll_time=datetime(2015, 11, 9, 10, 8, 15, 0, + tzinfo=pytz.utc + ), + ) def test_is_creator(self): """ Test is_creator method of Course""" @@ -926,6 +949,15 @@ class CourseTestCases(unittest.TestCase): self.assertIn(self.creator, trial_course.students.all()) self.assertTrue(trial_course.is_trial) + def test_disabled_enrollment_for_open_course(self): + """Test to check enrollment is closed for open course""" + self.assertFalse(self.open_course.is_active_enrollment()) + + def test_disabled_enrollment_for_enroll_request_course(self): + """Test to check enrollment is closed for open course""" + self.assertFalse(self.enroll_request_course.is_active_enrollment()) + + ############################################################################### class TestCaseTestCases(unittest.TestCase): |