diff options
author | maheshgudi | 2017-03-11 02:17:41 +0530 |
---|---|---|
committer | maheshgudi | 2017-03-11 03:03:28 +0530 |
commit | ac292ed1099b49f9d0e8a7ed3699bacdd8031de3 (patch) | |
tree | 0856b97e9bcf418b40103d7679169e657c817948 /yaksh/test_models.py | |
parent | 6961ff1cf46d4b8591a4528a2c3fef156268eec5 (diff) | |
download | online_test-ac292ed1099b49f9d0e8a7ed3699bacdd8031de3.tar.gz online_test-ac292ed1099b49f9d0e8a7ed3699bacdd8031de3.tar.bz2 online_test-ac292ed1099b49f9d0e8a7ed3699bacdd8031de3.zip |
made minor template changes and fixed test_models
Diffstat (limited to 'yaksh/test_models.py')
-rw-r--r-- | yaksh/test_models.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/yaksh/test_models.py b/yaksh/test_models.py index f0bb310..e6e4f74 100644 --- a/yaksh/test_models.py +++ b/yaksh/test_models.py @@ -669,7 +669,7 @@ class AnswerPaperTestCases(unittest.TestCase): self.assertEqual(current_question.summary, "Question1") # Test completed_question() method of Answer Paper - question = self.answerpaper.completed_question(self.question1.id) + question = self.answerpaper.add_completed_question(self.question1.id) self.assertEqual(self.answerpaper.questions_left(), 2) # Test next_question() method of Answer Paper @@ -684,7 +684,7 @@ class AnswerPaperTestCases(unittest.TestCase): self.assertEqual(next_question_id.summary, "Question3") # Given, here question is already answered - current_question_id = 1 + current_question_id = self.question1.id # When next_question_id = self.answerpaper.next_question(current_question_id) @@ -702,10 +702,10 @@ class AnswerPaperTestCases(unittest.TestCase): # Then self.assertTrue(next_question_id is not None) - self.assertEqual(next_question_id.summary, "Question2") + self.assertEqual(next_question_id.summary, "Question1") # Given, last question in the list - current_question_id = 3 + current_question_id = self.question3.id # When next_question_id = self.answerpaper.next_question(current_question_id) @@ -713,7 +713,7 @@ class AnswerPaperTestCases(unittest.TestCase): # Then self.assertTrue(next_question_id is not None) - self.assertEqual(next_question_id.summary, "Question2") + self.assertEqual(next_question_id.summary, "Question1") # Test get_questions_answered() method # When @@ -734,14 +734,18 @@ class AnswerPaperTestCases(unittest.TestCase): # Test completed_question and next_question # When all questions are answered - current_question = self.answerpaper.completed_question(self.question2.id) + current_question = self.answerpaper.add_completed_question( + self.question2.id + ) # Then self.assertEqual(self.answerpaper.questions_left(), 1) self.assertEqual(current_question.summary, "Question3") # When - current_question = self.answerpaper.completed_question(self.question3.id) + current_question = self.answerpaper.add_completed_question( + self.question3.id + ) # Then self.assertEqual(self.answerpaper.questions_left(), 0) |