diff options
author | adityacp | 2018-01-19 12:58:26 +0530 |
---|---|---|
committer | adityacp | 2018-01-19 12:58:26 +0530 |
commit | 1ab5018b89f6d566471eba26b1d206b1b142b8a0 (patch) | |
tree | 5910ededfa2085d8e818f863933e96f9760cfd08 | |
parent | bc8185f48856c30a37c4c80b0541bebbae2285a2 (diff) | |
download | online_test-1ab5018b89f6d566471eba26b1d206b1b142b8a0.tar.gz online_test-1ab5018b89f6d566471eba26b1d206b1b142b8a0.tar.bz2 online_test-1ab5018b89f6d566471eba26b1d206b1b142b8a0.zip |
Improve views test cases for lessons bug
-rw-r--r-- | yaksh/test_views.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/yaksh/test_views.py b/yaksh/test_views.py index 42e14b5..ff2b5a7 100644 --- a/yaksh/test_views.py +++ b/yaksh/test_views.py @@ -4475,6 +4475,7 @@ class TestLearningModule(TestCase): check_prerequisite=False, creator=self.user) self.course.teachers.add(self.teacher) self.course.learning_module.add(self.learning_module) + self.course.learning_module.add(self.learning_module1) self.expected_url = "/exam/manage/courses/all_learning_module/" @@ -4739,6 +4740,29 @@ class TestLearningModule(TestCase): self.assertEqual(response.context["current_unit"].id, self.learning_unit1.id) + # Go to next module with empty module + response = self.client.get( + reverse('yaksh:next_unit', + kwargs={"module_id": self.learning_module1.id, + "course_id": self.course.id}), + follow=True) + self.assertEqual(response.status_code, 200) + self.assertEqual(response.context["state"], "module") + self.assertEqual(response.context["learning_module"].id, + self.learning_module.id) + + # Go to next module from last unit of previous unit + response = self.client.get( + reverse('yaksh:next_unit', + kwargs={"module_id": self.learning_module.id, + "course_id": self.course.id, + "current_unit_id": self.learning_unit1.id}), + follow=True) + self.assertEqual(response.status_code, 200) + self.assertEqual(response.context["state"], "module") + self.assertEqual(response.context["learning_module"].id, + self.learning_module1.id) + class TestLessons(TestCase): def setUp(self): |