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