diff options
author | CruiseDevice | 2020-09-01 11:54:01 +0530 |
---|---|---|
committer | CruiseDevice | 2020-09-01 11:54:01 +0530 |
commit | a80fef3789d970d3db17d72f761fe156fe735259 (patch) | |
tree | 30c99e3bae767bc33081e83a287ea44b98fe726d /yaksh/test_models.py | |
parent | b41cf01f58544a6c71c16bab1854142a3ffc8e03 (diff) | |
download | online_test-a80fef3789d970d3db17d72f761fe156fe735259.tar.gz online_test-a80fef3789d970d3db17d72f761fe156fe735259.tar.bz2 online_test-a80fef3789d970d3db17d72f761fe156fe735259.zip |
Fix tests, Fix PEP8
Diffstat (limited to 'yaksh/test_models.py')
-rw-r--r-- | yaksh/test_models.py | 8 |
1 files changed, 5 insertions, 3 deletions
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) |