本文整理汇总了Python中openPLM.plmapp.controllers.DocumentController.can_attach_part方法的典型用法代码示例。如果您正苦于以下问题:Python DocumentController.can_attach_part方法的具体用法?Python DocumentController.can_attach_part怎么用?Python DocumentController.can_attach_part使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openPLM.plmapp.controllers.DocumentController
的用法示例。
在下文中一共展示了DocumentController.can_attach_part方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_attach
# 需要导入模块: from openPLM.plmapp.controllers import DocumentController [as 别名]
# 或者: from openPLM.plmapp.controllers.DocumentController import can_attach_part [as 别名]
def test_attach(self):
expected = []
result_part = []
result_doc = []
for pstate, dstate, powner, downer, can_attach in self.MATRICE:
self.part.object.state = self.states[pstate]
self.part.object.lifecycle = self.lifecycles[pstate]
self.doc.object.state = self.states[dstate]
self.doc.object.lifecycle = self.lifecycles[dstate]
self.part.set_owner(self.user if powner else self.other_owner, True)
self.doc.set_owner(self.user if downer else self.other_owner, True)
expected.append(can_attach)
pctrl = PartController(self.part.object, self.user)
result_part.append(pctrl.can_attach_document(self.doc.object))
dctrl = DocumentController(self.doc.object, self.user)
result_doc.append(dctrl.can_attach_part(self.part.object))
self.assertEqual(expected, result_part)
self.assertEqual(expected, result_doc)