summaryrefslogtreecommitdiff
path: root/yaksh/test_models.py
diff options
context:
space:
mode:
authoradityacp2020-11-03 15:03:10 +0530
committeradityacp2020-11-03 15:10:42 +0530
commit96c95dcdb543088008d8b202c1ecbb54f0ea1d45 (patch)
treebc9186c85a34b89c36c3800ca9998da2659f79eb /yaksh/test_models.py
parent602f88e334865c995d86a457acdca6cc43b354ef (diff)
parentff860034a56daa9229549c07d7bb74d479fdd6f7 (diff)
downloadonline_test-96c95dcdb543088008d8b202c1ecbb54f0ea1d45.tar.gz
online_test-96c95dcdb543088008d8b202c1ecbb54f0ea1d45.tar.bz2
online_test-96c95dcdb543088008d8b202c1ecbb54f0ea1d45.zip
Merge branch 'multiple_ui_fixes' of https://github.com/adityacp/online_test into multiple_ui_fixes
Diffstat (limited to 'yaksh/test_models.py')
-rw-r--r--yaksh/test_models.py15
1 files changed, 1 insertions, 14 deletions
diff --git a/yaksh/test_models.py b/yaksh/test_models.py
index 67da7d1..fe0d3b5 100644
--- a/yaksh/test_models.py
+++ b/yaksh/test_models.py
@@ -1788,20 +1788,7 @@ class AnswerPaperTestCases(unittest.TestCase):
""" Test get_question_answer() method of Answer Paper"""
questions = self.answerpaper.questions.all()
answered = self.answerpaper.get_question_answers()
- for question in questions:
- answers_saved = Answer.objects.filter(question=question)
- error_list = [json.loads(ans.error) for ans in answers_saved]
- if answers_saved:
- self.assertGreater(len(answered[question]), len(answers_saved))
- ans = []
- err = []
- for val in answered[question]:
- if val.get('answer') is not None:
- ans.append(val.get('answer'))
- if val.get('error_list') is not None:
- err.append(val.get('error_list'))
- self.assertEqual(set(ans), set(answers_saved))
- self.assertEqual(error_list, err)
+ self.assertEqual(list(questions), list(answered.keys()))
def test_is_answer_correct(self):
self.assertTrue(self.answerpaper.is_answer_correct(self.questions[0]))