summaryrefslogtreecommitdiff
path: root/yaksh/test_models.py
diff options
context:
space:
mode:
authoradityacp2021-01-25 13:12:56 +0530
committeradityacp2021-01-25 14:28:11 +0530
commit1e5c8af8748602d90a52f51d45799274155f8cd9 (patch)
treed51c46ee81866b7065f994b9e3c100457947312c /yaksh/test_models.py
parentc474c68a2621e8c470ce2751103128fa793be62e (diff)
downloadonline_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.py19
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)