summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--yaksh/test_views.py24
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):