summaryrefslogtreecommitdiff
path: root/yaksh/test_models.py
diff options
context:
space:
mode:
authorKing2018-07-12 14:00:59 -0700
committerGitHub2018-07-12 14:00:59 -0700
commit661c9d82bb680e745cc6b498131a0793b954c436 (patch)
tree9982e226f9bf81aaab98d752db3a8aba3de0c631 /yaksh/test_models.py
parentf61742f04f417cfb60576f9904afd0dc5c537b3c (diff)
parent714eeb188c67a6b61dfd132f0869e7679d91c8bf (diff)
downloadonline_test-661c9d82bb680e745cc6b498131a0793b954c436.tar.gz
online_test-661c9d82bb680e745cc6b498131a0793b954c436.tar.bz2
online_test-661c9d82bb680e745cc6b498131a0793b954c436.zip
Merge pull request #491 from maheshgudi/catch_compilation_error
Raise appropriate exceptions for C and Java language to the Grader
Diffstat (limited to 'yaksh/test_models.py')
-rw-r--r--yaksh/test_models.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/yaksh/test_models.py b/yaksh/test_models.py
index e2795bb..403dfb4 100644
--- a/yaksh/test_models.py
+++ b/yaksh/test_models.py
@@ -2,7 +2,8 @@ import unittest
from yaksh.models import User, Profile, Question, Quiz, QuestionPaper,\
QuestionSet, AnswerPaper, Answer, Course, StandardTestCase,\
StdIOBasedTestCase, FileUpload, McqTestCase, AssignmentUpload,\
- LearningModule, LearningUnit, Lesson, LessonFile, CourseStatus
+ LearningModule, LearningUnit, Lesson, LessonFile, CourseStatus, \
+ TestCaseOrder
from yaksh.code_server import (
ServerPool, get_result as get_result_from_code_server
)
@@ -1272,6 +1273,21 @@ class AnswerPaperTestCases(unittest.TestCase):
self.assertEqual(self.answer.marks, 0)
self.assertFalse(self.answer.correct)
+ def test_testcase_order(self):
+ testcase_ids = ",".join([str(ids) for ids in
+ self.question2.get_test_cases()
+ ])
+ testcase_order = TestCaseOrder.objects.create(
+ answer_paper=self.answerpaper,
+ question=self.question2,
+ order=testcase_ids)
+ with self.assertRaises(IntegrityError):
+ TestCaseOrder.objects.create(answer_paper=self.answerpaper,
+ question=self.question2,
+ order=testcase_ids
+ )
+ testcase_order.delete()
+
def test_validate_and_regrade_mcq_correct_answer(self):
# Given
mcq_answer = str(self.mcq_based_testcase.id)