本文整理汇总了Python中ralph.business.models.VentureRole.get_preboot方法的典型用法代码示例。如果您正苦于以下问题:Python VentureRole.get_preboot方法的具体用法?Python VentureRole.get_preboot怎么用?Python VentureRole.get_preboot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ralph.business.models.VentureRole
的用法示例。
在下文中一共展示了VentureRole.get_preboot方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_preboot_role_none
# 需要导入模块: from ralph.business.models import VentureRole [as 别名]
# 或者: from ralph.business.models.VentureRole import get_preboot [as 别名]
def test_get_preboot_role_none(self):
ven = Venture(name='test1', symbol='test1')
ven.save()
a = VentureRole(name='test1', venture_id = ven.id)
a.save()
b = VentureRole(name='test1 parent', parent_id = a.id, venture_id = ven.id)
b.save()
c = VentureRole(name='test1 parent parent', parent_id = b.id, venture_id = ven.id)
c.save()
self.assertEqual(a.get_preboot(), None)
self.assertEqual(b.get_preboot(), None)
self.assertEqual(c.get_preboot(), None)
示例2: test_get_preboot_role
# 需要导入模块: from ralph.business.models import VentureRole [as 别名]
# 或者: from ralph.business.models.VentureRole import get_preboot [as 别名]
def test_get_preboot_role(self):
preboot = Preboot(name='test preboot')
preboot.save()
ven = Venture(name='test1', symbol='test1', preboot = preboot)
ven.save()
a = VentureRole(name='test1', preboot = preboot, venture_id = ven.id)
a.save()
b = VentureRole(name='test1 parent', parent_id = a.id, venture_id = ven.id)
b.save()
c = VentureRole(name='test1 parent parent', parent_id = b.id, venture_id = ven.id)
c.save()
self.assertEqual(a.get_preboot(), preboot)
self.assertEqual(b.get_preboot(), preboot)
self.assertEqual(c.get_preboot(), preboot)