本文整理汇总了Python中plone.app.iterate.interfaces.ICheckinCheckoutPolicy.keys方法的典型用法代码示例。如果您正苦于以下问题:Python ICheckinCheckoutPolicy.keys方法的具体用法?Python ICheckinCheckoutPolicy.keys怎么用?Python ICheckinCheckoutPolicy.keys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类plone.app.iterate.interfaces.ICheckinCheckoutPolicy
的用法示例。
在下文中一共展示了ICheckinCheckoutPolicy.keys方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_cancel_checkout
# 需要导入模块: from plone.app.iterate.interfaces import ICheckinCheckoutPolicy [as 别名]
# 或者: from plone.app.iterate.interfaces.ICheckinCheckoutPolicy import keys [as 别名]
def test_cancel_checkout(self):
self.setRoles(('Contributor',))
p1 = self.places['1']
self.failUnless('foo' in p1, p1.keys())
wc = ICheckinCheckoutPolicy(p1).checkout(self.places)
self.failUnlessEqual(len(wc.keys()), 0, wc.keys())
p1 = ICheckinCheckoutPolicy(wc).cancelCheckout()
self.failUnless('foo' in p1, p1.keys())
# A child's history acquires its parent's history
history = self.repo.getHistory(p1['foo'])
self.failUnlessEqual(len(history), 1)
示例2: test_add_name_to_wc
# 需要导入模块: from plone.app.iterate.interfaces import ICheckinCheckoutPolicy [as 别名]
# 或者: from plone.app.iterate.interfaces.ICheckinCheckoutPolicy import keys [as 别名]
def test_add_name_to_wc(self):
self.setRoles(('Contributor',))
p1 = self.places['1']
self.failUnless('foo' in p1, p1.keys())
wc = ICheckinCheckoutPolicy(p1).checkout(self.places)
nid = wc.invokeFactory('Name', 'bar', nameTransliterated=u"Bar")
self.failUnless('bar' in wc, wc.keys())
p1 = ICheckinCheckoutPolicy(wc).checkin("updated")
self.failUnless('foo' in p1, p1.keys())
self.failUnless('bar' in p1, p1.keys())
# A child's history acquires its parent's history
history = self.repo.getHistory(p1['foo'])
self.failUnlessEqual(len(history), 2)
history = self.repo.getHistory(p1['bar'])
self.failUnlessEqual(len(history), 1)
示例3: test_nothing
# 需要导入模块: from plone.app.iterate.interfaces import ICheckinCheckoutPolicy [as 别名]
# 或者: from plone.app.iterate.interfaces.ICheckinCheckoutPolicy import keys [as 别名]
def test_nothing(self):
self.setRoles(('Contributor',))
p1 = self.places['1']
self.failUnless('foo' in p1, p1.keys())
wc = ICheckinCheckoutPolicy(p1).checkout(self.places)
state = self.wf.getInfoFor(wc, 'review_state')
self.failUnlessEqual(state, 'private')
self.failUnlessEqual(len(wc.keys()), 0, wc.keys())
# A child's history acquires its parent's history
history = self.repo.getHistory(p1['foo'])
self.failUnlessEqual(len(history), 1)
p1 = ICheckinCheckoutPolicy(wc).checkin("updated")
self.failUnless('foo' in p1, p1.keys())
# A child's history acquires its parent's history
history = self.repo.getHistory(p1['foo'])
self.failUnlessEqual(len(history), 2)