本文整理汇总了Python中eums.test.factories.delivery_node_factory.DeliveryNodeFactory.responses方法的典型用法代码示例。如果您正苦于以下问题:Python DeliveryNodeFactory.responses方法的具体用法?Python DeliveryNodeFactory.responses怎么用?Python DeliveryNodeFactory.responses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eums.test.factories.delivery_node_factory.DeliveryNodeFactory
的用法示例。
在下文中一共展示了DeliveryNodeFactory.responses方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_gets_all_response_for_node_consignee
# 需要导入模块: from eums.test.factories.delivery_node_factory import DeliveryNodeFactory [as 别名]
# 或者: from eums.test.factories.delivery_node_factory.DeliveryNodeFactory import responses [as 别名]
def test_gets_all_response_for_node_consignee(self):
multichoice_question = MultipleChoiceQuestionFactory(label='productReceived')
yes_option = OptionFactory(text='Yes', question=multichoice_question)
no_option = OptionFactory(text='No', question=multichoice_question)
sugar = ItemFactory(description='Sugar')
salt = ItemFactory(description='Salt')
numeric_question = NumericQuestionFactory(label='AmountReceived')
item = SalesOrderItemFactory(item=salt, description='10 bags of salt')
salt_node = DeliveryNodeFactory(quantity=100, item=PurchaseOrderItemFactory(sales_order_item=item))
run = RunFactory(runnable=salt_node, status='completed')
sugar_item = SalesOrderItemFactory(item=sugar, description='10 bags of sugar')
sugar_node = DeliveryNodeFactory(quantity=100, item=PurchaseOrderItemFactory(sales_order_item=sugar_item))
sugar_run = RunFactory(runnable=sugar_node, status='completed')
multiple_answer_one = MultipleChoiceAnswerFactory(run=run, question=multichoice_question, value=yes_option)
numeric_answer_one = NumericAnswerFactory(run=run, value=80, question=numeric_question)
multiple_answer_two = MultipleChoiceAnswerFactory(run=sugar_run, question=multichoice_question, value=no_option)
numeric_answer_two = NumericAnswerFactory(run=sugar_run, value=80, question=numeric_question)
salt_node_responses = salt_node.responses()
sugar_node_responses = sugar_node.responses()
self.assertIn(multiple_answer_one, salt_node_responses[run])
self.assertIn(numeric_answer_one, salt_node_responses[run])
self.assertIn(multiple_answer_two, sugar_node_responses[sugar_run])
self.assertIn(numeric_answer_two, sugar_node_responses[sugar_run])