summaryrefslogtreecommitdiff
path: root/yaksh/test_views.py
diff options
context:
space:
mode:
authoradityacp2018-02-20 12:04:05 +0530
committeradityacp2018-02-20 12:04:05 +0530
commit2a46206abfd04509707f7bf21a9f6dbc1b2b6b82 (patch)
treec3385f10813df5bfbff612457e08c0045bbc64a9 /yaksh/test_views.py
parentd183f9882e43b650ed5d189cf451f0210135e2f4 (diff)
parent438f8657021981fc7b2e5adbacc13eb332a2e6d3 (diff)
downloadonline_test-2a46206abfd04509707f7bf21a9f6dbc1b2b6b82.tar.gz
online_test-2a46206abfd04509707f7bf21a9f6dbc1b2b6b82.tar.bz2
online_test-2a46206abfd04509707f7bf21a9f6dbc1b2b6b82.zip
Update to latest changes
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 04aff8b..fb33114 100644
--- a/yaksh/test_views.py
+++ b/yaksh/test_views.py
@@ -5165,6 +5165,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(