Exemplo n.º 1
0
 def test_input_multi_choice_question(self):
     self.assertTrue(
         qa_mapping.get_answer_model(InputMultiChoiceQuestion) is
         qa_mapping.get_answer_model('inputmultichoicequestion') is
         qa_mapping.get_answer_model(InputMultiChoiceQuestion.objects.first(
         )) is UserInputMultiChoiceAnswer)
Exemplo n.º 2
0
 def test_input_question(self):
     self.assertTrue(
         qa_mapping.get_answer_model(InputQuestion) is qa_mapping.
         get_answer_model('inputquestion') is qa_mapping.get_answer_model(
             InputQuestion.objects.first()) is UserInputAnswer)
Exemplo n.º 3
0
 def test_choice_question(self):
     self.assertTrue(
         qa_mapping.get_answer_model(ChoiceQuestion) is qa_mapping.
         get_answer_model('choicequestion') is qa_mapping.get_answer_model(
             ChoiceQuestion.objects.first()) is UserChoiceAnswer)
Exemplo n.º 4
0
 def get_queryset(self):
     if is_swagger_fake_view(self):
         return UserAnswer.objects.all()
     return qa_mapping.get_answer_model(
         self.question).objects.filter(question=self.question)