diff options
author | ankitjavalkar | 2017-03-02 10:34:37 +0530 |
---|---|---|
committer | ankitjavalkar | 2017-03-06 17:35:17 +0530 |
commit | 0f2a42799d3140de132c203cc255516caa69d617 (patch) | |
tree | 0e1718e3f087e7981224205b28882693e85ef385 | |
parent | 0f730a5adc35e06f22f89fbbaa2d810e57074561 (diff) | |
download | online_test-0f2a42799d3140de132c203cc255516caa69d617.tar.gz online_test-0f2a42799d3140de132c203cc255516caa69d617.tar.bz2 online_test-0f2a42799d3140de132c203cc255516caa69d617.zip |
Rename completed_question model method to add_completed_question
-rw-r--r-- | yaksh/models.py | 2 | ||||
-rw-r--r-- | yaksh/test_models.py | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/yaksh/models.py b/yaksh/models.py index 61c9059..b80482c 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -982,7 +982,7 @@ class AnswerPaper(models.Model): """Returns the number of questions left.""" return self.questions_unanswered.count() - def completed_question(self, question_id): + def add_completed_question(self, question_id): """ Adds the completed question to the list of answered questions and returns the next question. diff --git a/yaksh/test_models.py b/yaksh/test_models.py index 91d8806..a8d48e2 100644 --- a/yaksh/test_models.py +++ b/yaksh/test_models.py @@ -662,7 +662,7 @@ class AnswerPaperTestCases(unittest.TestCase): current_question = self.answerpaper.current_question() self.assertEqual(current_question.id, 1) # Test completed_question() method of Answer Paper - question = self.answerpaper.completed_question(1) + question = self.answerpaper.add_completed_question(1) self.assertEqual(self.answerpaper.questions_left(), 2) # Test next_question() method of Answer Paper @@ -724,14 +724,14 @@ class AnswerPaperTestCases(unittest.TestCase): # Test completed_question and next_question # When all questions are answered - current_question = self.answerpaper.completed_question(2) + current_question = self.answerpaper.add_completed_question(2) # Then self.assertEqual(self.answerpaper.questions_left(), 1) self.assertEqual(current_question.id, 3) # When - current_question = self.answerpaper.completed_question(3) + current_question = self.answerpaper.add_completed_question(3) # Then self.assertEqual(self.answerpaper.questions_left(), 0) |