summaryrefslogtreecommitdiff
path: root/yaksh/test_models.py
diff options
context:
space:
mode:
authoradityacp2016-12-23 15:03:37 +0530
committeradityacp2016-12-23 15:03:37 +0530
commitd442941819dc7f8b65a2965fbcefe000fea1cde2 (patch)
tree624d8ba12cf83cf57f685bc8cee158be14aee783 /yaksh/test_models.py
parent14b628f49a7d0aa58c22c021c62a5d0a748ae881 (diff)
parent48366e84b98157ac32b22b2aa19b1c1cde68afd4 (diff)
downloadonline_test-d442941819dc7f8b65a2965fbcefe000fea1cde2.tar.gz
online_test-d442941819dc7f8b65a2965fbcefe000fea1cde2.tar.bz2
online_test-d442941819dc7f8b65a2965fbcefe000fea1cde2.zip
Fix conflict
Diffstat (limited to 'yaksh/test_models.py')
-rw-r--r--yaksh/test_models.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/yaksh/test_models.py b/yaksh/test_models.py
index ee141bc..e95528b 100644
--- a/yaksh/test_models.py
+++ b/yaksh/test_models.py
@@ -488,12 +488,14 @@ class AnswerPaperTestCases(unittest.TestCase):
# answers for the Answer Paper
self.answer_right = Answer(question=Question.objects.get(id=1),
answer="Demo answer",
- correct=True, marks=1
+ correct=True, marks=1,
+ error=json.dumps([])
)
self.answer_wrong = Answer(question=Question.objects.get(id=2),
answer="My answer",
correct=False,
- marks=0
+ marks=0,
+ error=json.dumps(['error1', 'error2'])
)
self.answer_right.save()
self.answer_wrong.save()
@@ -551,7 +553,7 @@ class AnswerPaperTestCases(unittest.TestCase):
# Then
self.assertTrue(correct)
self.assertTrue(result['success'])
- self.assertEqual(result['error'], 'Correct answer')
+ self.assertEqual(result['error'], ['Correct answer'])
self.answer.correct = True
self.answer.marks = 1
@@ -588,7 +590,6 @@ class AnswerPaperTestCases(unittest.TestCase):
# Then
self.assertTrue(correct)
self.assertTrue(result['success'])
- self.assertEqual(result['error'], 'Correct answer')
self.answer.correct = True
self.answer.marks = 1
@@ -730,8 +731,9 @@ class AnswerPaperTestCases(unittest.TestCase):
""" Test get_question_answer() method of Answer Paper"""
answered = self.answerpaper.get_question_answers()
first_answer = list(answered.values())[0][0]
- self.assertEqual(first_answer.answer, 'Demo answer')
- self.assertTrue(first_answer.correct)
+ first_answer_obj = first_answer['answer']
+ self.assertEqual(first_answer_obj.answer, 'Demo answer')
+ self.assertTrue(first_answer_obj.correct)
self.assertEqual(len(answered), 2)
def test_is_answer_correct(self):