From a80fef3789d970d3db17d72f761fe156fe735259 Mon Sep 17 00:00:00 2001 From: CruiseDevice Date: Tue, 1 Sep 2020 11:54:01 +0530 Subject: Fix tests, Fix PEP8 --- yaksh/test_models.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'yaksh/test_models.py') diff --git a/yaksh/test_models.py b/yaksh/test_models.py index a77c8bf..a48876c 100644 --- a/yaksh/test_models.py +++ b/yaksh/test_models.py @@ -1654,12 +1654,14 @@ class AnswerPaperTestCases(unittest.TestCase): answers_saved = Answer.objects.filter(question=question) error_list = [json.loads(ans.error) for ans in answers_saved] if answers_saved: - self.assertEqual(len(answered[question]), len(answers_saved)) + self.assertGreater(len(answered[question]), len(answers_saved)) ans = [] err = [] for val in answered[question]: - ans.append(val.get('answer')) - err.append(val.get('error_list')) + 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) -- cgit