summaryrefslogtreecommitdiff
path: root/yaksh/test_views.py
diff options
context:
space:
mode:
authorPrabhu Ramachandran2018-02-15 19:28:53 +0530
committerGitHub2018-02-15 19:28:53 +0530
commit3e4fa8a4b6f0b16731f27b724fad119ee74dc618 (patch)
tree7e326dcfa3897f624c8c3cf637543646b86b7491 /yaksh/test_views.py
parent7a89ac6dabe7d2b8d914c8efde30c65f365bd771 (diff)
parent617d09ca9b05185d9a2310c106360091ed8a1b1a (diff)
downloadonline_test-3e4fa8a4b6f0b16731f27b724fad119ee74dc618.tar.gz
online_test-3e4fa8a4b6f0b16731f27b724fad119ee74dc618.tar.bz2
online_test-3e4fa8a4b6f0b16731f27b724fad119ee74dc618.zip
Merge pull request #436 from adityacp/fixes_lesson_feature
Additions and fixes for lesson feature
Diffstat (limited to 'yaksh/test_views.py')
-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 9be8d13..3b27338 100644
--- a/yaksh/test_views.py
+++ b/yaksh/test_views.py
@@ -5079,6 +5079,30 @@ class TestLessons(TestCase):
self.assertEqual(response.status_code, 200)
self.assertEqual(response.context["msg"], err_msg)
+ # Check if lesson is active
+ self.lesson.active = False
+ self.lesson.save()
+ response = self.client.get(
+ reverse('yaksh:show_lesson',
+ kwargs={"lesson_id": self.lesson.id,
+ "module_id": self.learning_module.id,
+ "course_id": self.course.id}))
+ err_msg = "{0} is not active".format(self.lesson.name)
+ self.assertEqual(response.status_code, 200)
+ self.assertEqual(response.context["msg"], err_msg)
+
+ # Check if module is active
+ self.learning_module2.active = False
+ self.learning_module2.save()
+ response = self.client.get(
+ reverse('yaksh:show_lesson',
+ kwargs={"lesson_id": self.lesson2.id,
+ "module_id": self.learning_module2.id,
+ "course_id": self.course.id}))
+ err_msg = "{0} is not active".format(self.learning_module2.name)
+ self.assertEqual(response.status_code, 200)
+ self.assertEqual(response.context["msg"], err_msg)
+
def test_show_all_lessons(self):
""" Moderator should be able to see all created lessons"""
self.client.login(