diff options
author | adityacp | 2021-01-26 14:38:46 +0530 |
---|---|---|
committer | adityacp | 2021-01-26 14:38:46 +0530 |
commit | 7f28b418b616823f542faea8311e881faf6286c2 (patch) | |
tree | 4bb4c82c0adc7fb8f463fc03142dd310a03268c6 /yaksh/test_views.py | |
parent | 1e5c8af8748602d90a52f51d45799274155f8cd9 (diff) | |
download | online_test-7f28b418b616823f542faea8311e881faf6286c2.tar.gz online_test-7f28b418b616823f542faea8311e881faf6286c2.tar.bz2 online_test-7f28b418b616823f542faea8311e881faf6286c2.zip |
Refactor question statistics for a quiz
Diffstat (limited to 'yaksh/test_views.py')
-rw-r--r-- | yaksh/test_views.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/yaksh/test_views.py b/yaksh/test_views.py index 89d209e..8973d9f 100644 --- a/yaksh/test_views.py +++ b/yaksh/test_views.py @@ -5671,11 +5671,9 @@ class TestShowStatistics(TestCase): self.assertEqual(response.status_code, 200) self.assertTemplateUsed(response, 'yaksh/statistics_question.html') self.assertIn(self.question, list(question_stats.keys())) - self.assertSequenceEqual( - list(question_stats.values())[0]['answered'], [1, 1] - ) - self.assertEqual(response.context['attempts'][0], 1) - self.assertEqual(response.context['total'], 1) + q_data = list(question_stats.values())[0] + self.assertSequenceEqual(q_data[0:2], [1, 1]) + self.assertEqual(100, q_data[2]) class TestQuestionPaper(TestCase): |