diff options
Diffstat (limited to 'yaksh/test_models.py')
-rw-r--r-- | yaksh/test_models.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/yaksh/test_models.py b/yaksh/test_models.py index c0721f3..ca64f8c 100644 --- a/yaksh/test_models.py +++ b/yaksh/test_models.py @@ -1,7 +1,7 @@ import unittest from yaksh.models import User, Profile, Question, Quiz, QuestionPaper,\ QuestionSet, AnswerPaper, Answer, Course, StandardTestCase,\ - StdoutBasedTestCase + StdioBasedTestCase import json from datetime import datetime, timedelta from django.utils import timezone @@ -252,6 +252,18 @@ class QuizTestCases(unittest.TestCase): ) self.assertEqual(trial_quiz.time_between_attempts, 0) + def test_view_answerpaper(self): + self.assertFalse(self.quiz1.view_answerpaper) + self.assertFalse(self.quiz2.view_answerpaper) + + # When + self.quiz1.view_answerpaper = True + self.quiz1.save() + + # Then + self.assertTrue(self.quiz1.view_answerpaper) + + ############################################################################### class QuestionPaperTestCases(unittest.TestCase): @@ -697,7 +709,7 @@ class TestCaseTestCases(unittest.TestCase): active=True, description='Write to standard output', points=1.0, - test_case_type="stdoutbasedtestcase", + test_case_type="stdiobasedtestcase", user=self.user, snippet='def myfunc()' ) @@ -707,7 +719,7 @@ class TestCaseTestCases(unittest.TestCase): question=self.question1, test_case='assert myfunc(12, 13) == 15' ) - self.stdout_based_testcase = StdoutBasedTestCase( + self.stdout_based_testcase = StdioBasedTestCase( question=self.question2, expected_output='Hello World' ) |