summaryrefslogtreecommitdiff
path: root/yaksh/test_views.py
diff options
context:
space:
mode:
authoradityacp2020-09-25 10:50:54 +0530
committeradityacp2020-09-25 13:24:05 +0530
commit7a24df37612c2a634f0e0422f1469891cc14deaf (patch)
tree5ef6657c7aadf679febb6c6677658121fd4f29b5 /yaksh/test_views.py
parent0c5f2afb084c0a4efd1715d53909ce2bb07b5883 (diff)
downloadonline_test-7a24df37612c2a634f0e0422f1469891cc14deaf.tar.gz
online_test-7a24df37612c2a634f0e0422f1469891cc14deaf.tar.bz2
online_test-7a24df37612c2a634f0e0422f1469891cc14deaf.zip
Fix tests
Diffstat (limited to 'yaksh/test_views.py')
-rw-r--r--yaksh/test_views.py32
1 files changed, 30 insertions, 2 deletions
diff --git a/yaksh/test_views.py b/yaksh/test_views.py
index 16f1a98..7383c6c 100644
--- a/yaksh/test_views.py
+++ b/yaksh/test_views.py
@@ -6616,7 +6616,7 @@ class TestLessons(TestCase):
)
self.assertEqual(response.status_code, 200)
self.assertIn(
- "Video path : Only one of the video name should be entered",
+ "Video path : Only one type of video path is allowed",
str(response.content)
)
@@ -6633,7 +6633,7 @@ class TestLessons(TestCase):
)
self.assertEqual(response.status_code, 200)
self.assertIn(
- "Video path : Value must be dictionary as shown in sample",
+ "Video path : Value must be dictionary",
str(response.content)
)
@@ -8454,5 +8454,33 @@ class TestLessonContents(TestCase):
self.assertEqual(
json_response.get("message"), "You answered the question correctly"
)
+ self.client.logout()
+ self.client.login(
+ username=self.user1.username,
+ password=self.user1_plaintext_pass
+ )
+
+ # Get statistics for mcc question
+ response = self.client.get(
+ reverse('yaksh:lesson_statistics',
+ kwargs={"course_id": self.user1_course1.id,
+ "lesson_id": self.lesson1.id,
+ "toc_id": tocs[1]})
+ )
+ response_data = response.context
+ student_info = response_data.get("objects").object_list[0]
+ self.assertEqual(response.status_code, 200)
+ self.assertEqual(student_info.get("student_id"), self.student.id)
+ # Get statistics for mcq question
+ response = self.client.get(
+ reverse('yaksh:lesson_statistics',
+ kwargs={"course_id": self.user1_course1.id,
+ "lesson_id": self.lesson1.id,
+ "toc_id": tocs[0]})
+ )
+ response_data = response.context
+ student_info = response_data.get("objects").object_list[0]
+ self.assertEqual(response.status_code, 200)
+ self.assertEqual(student_info.get("student_id"), self.student.id)