diff options
author | CruiseDevice | 2019-02-18 16:11:26 +0530 |
---|---|---|
committer | CruiseDevice | 2019-02-18 16:45:17 +0530 |
commit | 4fc937e5d552836c028b46196b47436457bcb6da (patch) | |
tree | 2be11b894c5205e09ae25a65b58d8a6e8c7a3a97 /yaksh/test_views.py | |
parent | cc710ca137bb5866c6771ba60b94a9fcce9054c5 (diff) | |
download | online_test-4fc937e5d552836c028b46196b47436457bcb6da.tar.gz online_test-4fc937e5d552836c028b46196b47436457bcb6da.tar.bz2 online_test-4fc937e5d552836c028b46196b47436457bcb6da.zip |
Fix TestCases
Diffstat (limited to 'yaksh/test_views.py')
-rw-r--r-- | yaksh/test_views.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/yaksh/test_views.py b/yaksh/test_views.py index 274bcda..70c54e3 100644 --- a/yaksh/test_views.py +++ b/yaksh/test_views.py @@ -5017,19 +5017,25 @@ class TestQuestionPaper(TestCase): ) self.assertEqual(response.status_code, 404) - def test_preview_qustionpaper_without_quiz_owner(self): + def test_preview_questionpaper_without_quiz_owner(self): self.client.login( username=self.teacher.username, password=self.teacher_plaintext_pass ) - # Should raise an HTTP 404 response + # Should pass successfully response = self.client.get( reverse('yaksh:preview_questionpaper', kwargs={"questionpaper_id": self.question_paper.id} ) ) - self.assertEqual(response.status_code, 404) + self.assertEqual(response.status_code, 200) + self.assertTemplateUsed(response, 'yaksh/preview_questionpaper.html') + self.assertEqual( + response.context['questions'], + self.questions_list + ) + self.assertEqual(response.context['paper'], self.question_paper) def test_mcq_attempt_right_after_wrong(self): """ Case:- Check if answerpaper and answer marks are updated after |