コード例 #1
0
 def test_should_tell_if_question_answer_combination_ends_the_flow(self):
     answer_1 = MultipleChoiceAnswerFactory()
     answer_2 = MultipleChoiceAnswerFactory()
     flow = Flow(end_nodes=[[answer_1.question.id, answer_1.value.id],
                            [answer_2.question.id, answer_2.value.id]])
     self.assertTrue(flow.is_end(answer_1))
     self.assertTrue(flow.is_end(answer_2))
コード例 #2
0
ファイル: test_flow.py プロジェクト: raymondyan/eums
 def test_should_tell_if_question_answer_combination_ends_the_flow(self):
     answer_1 = MultipleChoiceAnswerFactory()
     answer_2 = MultipleChoiceAnswerFactory()
     flow = Flow(end_nodes=[
         [answer_1.question.id, answer_1.value.id],
         [answer_2.question.id, answer_2.value.id]
     ])
     self.assertTrue(flow.is_end(answer_1))
     self.assertTrue(flow.is_end(answer_2))
コード例 #3
0
ファイル: test_flow.py プロジェクト: raymondyan/eums
 def test_should_tell_if_numeric_question_ends_the_flow(self):
     answer = NumericAnswerFactory()
     flow = Flow(end_nodes=[[answer.question.id, Flow.NO_OPTION]])
     self.assertTrue(flow.is_end(answer))
コード例 #4
0
ファイル: test_flow.py プロジェクト: raymondyan/eums
 def test_should_tell_if_question_answer_combination_does_not_end_the_flow(self):
     answer = MultipleChoiceAnswerFactory()
     flow = Flow()
     self.assertFalse(flow.is_end(answer))
コード例 #5
0
 def test_should_tell_if_numeric_question_ends_the_flow(self):
     answer = NumericAnswerFactory()
     flow = Flow(end_nodes=[[answer.question.id, Flow.NO_OPTION]])
     self.assertTrue(flow.is_end(answer))
コード例 #6
0
 def test_should_tell_if_question_answer_combination_does_not_end_the_flow(
         self):
     answer = MultipleChoiceAnswerFactory()
     flow = Flow()
     self.assertFalse(flow.is_end(answer))