本文整理汇总了Python中plone.app.iterate.interfaces.ICheckinCheckoutPolicy.getId方法的典型用法代码示例。如果您正苦于以下问题:Python ICheckinCheckoutPolicy.getId方法的具体用法?Python ICheckinCheckoutPolicy.getId怎么用?Python ICheckinCheckoutPolicy.getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类plone.app.iterate.interfaces.ICheckinCheckoutPolicy
的用法示例。
在下文中一共展示了ICheckinCheckoutPolicy.getId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_folderOrder
# 需要导入模块: from plone.app.iterate.interfaces import ICheckinCheckoutPolicy [as 别名]
# 或者: from plone.app.iterate.interfaces.ICheckinCheckoutPolicy import getId [as 别名]
def test_folderOrder(self):
"""When an item is checked out and then back in, the original
folder order is preserved."""
container = self.portal.docs
doc = container.doc1
original_position = container.getObjectPosition(doc.getId())
# check that there is another document which could interact with
# position of document the test work on
doc2_position = container.getObjectPosition('doc2')
self.assertTrue(doc2_position > original_position)
self.repo.save(doc)
wc = ICheckinCheckoutPolicy(doc).checkout(container)
wc.update(text='new document text')
# check that the copy is put after the second document
copy_position = container.getObjectPosition(wc.getId())
self.assertTrue(copy_position > doc2_position)
new_doc = ICheckinCheckoutPolicy(wc).checkin("updated")
new_position = container.getObjectPosition(new_doc.getId())
self.assertEqual(new_position, original_position)