本文整理汇总了Python中plone.app.iterate.interfaces.ICheckinCheckoutPolicy.getBackReferences方法的典型用法代码示例。如果您正苦于以下问题:Python ICheckinCheckoutPolicy.getBackReferences方法的具体用法?Python ICheckinCheckoutPolicy.getBackReferences怎么用?Python ICheckinCheckoutPolicy.getBackReferences使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类plone.app.iterate.interfaces.ICheckinCheckoutPolicy
的用法示例。
在下文中一共展示了ICheckinCheckoutPolicy.getBackReferences方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_wcNewBackwardReferencesCopied
# 需要导入模块: from plone.app.iterate.interfaces import ICheckinCheckoutPolicy [as 别名]
# 或者: from plone.app.iterate.interfaces.ICheckinCheckoutPolicy import getBackReferences [as 别名]
def test_wcNewBackwardReferencesCopied( self ):
# ensure that new wc back references are copied back to the baseline on checkin
doc = self.portal.docs.doc1
self.assertEqual( len(doc.getBackReferences("zebra")), 0)
wc = ICheckinCheckoutPolicy( doc ).checkout( self.portal.workarea )
self.portal.docs.doc2.addReference( wc, "zebra")
self.assertEqual( len( wc.getBackReferences("zebra")), 1 )
doc = ICheckinCheckoutPolicy( wc ).checkin( "updated")
self.assertEqual( len( doc.getBackReferences("zebra")), 1 )
示例2: test_baselineReferencesMaintained
# 需要导入模块: from plone.app.iterate.interfaces import ICheckinCheckoutPolicy [as 别名]
# 或者: from plone.app.iterate.interfaces.ICheckinCheckoutPolicy import getBackReferences [as 别名]
def test_baselineReferencesMaintained(self):
# ensure that baseline references are maintained when the object is
# checked in copies forward, bkw are not copied, but are maintained.
doc = self.portal.docs.doc1
doc.addReference(self.portal.docs, "elephant")
self.portal.docs.doc2.addReference(doc)
wc = ICheckinCheckoutPolicy(doc).checkout(self.portal.workarea)
doc = ICheckinCheckoutPolicy(wc).checkin("updated")
# TODO: This fails in Plone 4.1. The new optimized catalog lookups
# in the reference catalog no longer filter out non-existing reference
# objects. In both Plone 4.0 and 4.1 there's two references, one of
# them is a stale catalog entry in the reference catalog. The real fix
# is to figure out how the stale catalog entry gets in there
self.assertEqual(len(doc.getReferences()), 1)
self.assertEqual(len(doc.getBackReferences()), 1)