diff options
author | adityacp | 2021-01-25 13:12:56 +0530 |
---|---|---|
committer | adityacp | 2021-01-25 14:28:11 +0530 |
commit | 1e5c8af8748602d90a52f51d45799274155f8cd9 (patch) | |
tree | d51c46ee81866b7065f994b9e3c100457947312c /yaksh/test_models.py | |
parent | c474c68a2621e8c470ce2751103128fa793be62e (diff) | |
download | online_test-1e5c8af8748602d90a52f51d45799274155f8cd9.tar.gz online_test-1e5c8af8748602d90a52f51d45799274155f8cd9.tar.bz2 online_test-1e5c8af8748602d90a52f51d45799274155f8cd9.zip |
Fix views and models tests
Diffstat (limited to 'yaksh/test_models.py')
-rw-r--r-- | yaksh/test_models.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/yaksh/test_models.py b/yaksh/test_models.py index fe0d3b5..a424b36 100644 --- a/yaksh/test_models.py +++ b/yaksh/test_models.py @@ -1416,27 +1416,34 @@ class AnswerPaperTestCases(unittest.TestCase): def test_get_per_question_score(self): # Given question_id = self.question4.id - expected_score = 1 + question_name = self.question4.summary + expected_score = {"Q4": 1.0} # When score = self.answerpaper_single_question.get_per_question_score( - question_id + [(question_name, question_id)] ) # Then self.assertEqual(score, expected_score) # Given question_id = self.question2.id - expected_score = 0 + question_name = self.question2.summary + expected_score = {"Q2": 0.0} # When - score = self.answerpaper.get_per_question_score(question_id) + score = self.answerpaper.get_per_question_score( + [(question_name, question_id)] + ) # Then self.assertEqual(score, expected_score) # Given question_id = 131 - expected_score = 'NA' + question_name = "NA" + expected_score = {'NA': 0} # When - score = self.answerpaper.get_per_question_score(question_id) + score = self.answerpaper.get_per_question_score( + [(question_name, question_id)] + ) # Then self.assertEqual(score, expected_score) |