Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adityacp committed Sep 25, 2020
1 parent 0c5f2af commit 7a24df3
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions yaksh/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6616,7 +6616,7 @@ def test_teacher_can_edit_lesson(self):
)
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)
)

Expand All @@ -6633,7 +6633,7 @@ def test_teacher_can_edit_lesson(self):
)
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)
)

Expand Down Expand Up @@ -8454,5 +8454,33 @@ def test_multiple_lesson_question_types(self):
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)

0 comments on commit 7a24df3

Please sign in to comment.