本文整理汇总了Python中OFS.Folder.Folder._setId方法的典型用法代码示例。如果您正苦于以下问题:Python Folder._setId方法的具体用法?Python Folder._setId怎么用?Python Folder._setId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OFS.Folder.Folder
的用法示例。
在下文中一共展示了Folder._setId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_forbidden_tools
# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import _setId [as 别名]
def test_forbidden_tools( self ):
from Products.GenericSetup.tool import TOOLSET_XML
from Products.GenericSetup.tool import importToolset
TOOL_IDS = ( 'doomed', 'blasted', 'saved' )
site = self._initSite()
for tool_id in TOOL_IDS:
pseudo = Folder()
pseudo._setId( tool_id )
site._setObject( tool_id, pseudo )
self.assertEqual( len( site.objectIds() ), len( TOOL_IDS ) + 1 )
for tool_id in TOOL_IDS:
self.failUnless( tool_id in site.objectIds() )
context = DummyImportContext( site, tool=site.setup_tool )
context._files[ TOOLSET_XML ] = _FORBIDDEN_TOOLSET_XML
importToolset( context )
self.assertEqual( len( site.objectIds() ), 2 )
self.failUnless( 'setup_tool' in site.objectIds() )
self.failUnless( 'saved' in site.objectIds() )
示例2: _makeSite
# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import _setId [as 别名]
def _makeSite( self, title="Don't care" ):
site = Folder()
site._setId( 'site' )
site.title = title
self.app._setObject( 'site', site )
return self.app._getOb( 'site' )
示例3: _initSite
# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import _setId [as 别名]
def _initSite( self ):
from Products.GenericSetup.tool import SetupTool
site = Folder()
site._setId( 'site' )
self.app._setObject( 'site', site )
site = self.app._getOb( 'site' )
site._setObject('setup_tool', SetupTool('setup_tool'))
return site
示例4: _initSite
# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import _setId [as 别名]
def _initSite( self ):
from Products.CMFSetup.tool import SetupTool
site = Folder()
site._setId( 'site' )
self.root._setObject( 'site', site )
site = self.root._getOb( 'site' )
site._setObject( 'portal_setup', SetupTool() )
return site
示例5: test__setObject_no_ownership_fixup
# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import _setId [as 别名]
def test__setObject_no_ownership_fixup( self ):
from AccessControl.SpecialUsers import emergency_user
from OFS.Folder import Folder
newSecurityManager( None, emergency_user )
rc, root, folder, object = self._makeTree()
zcuf = self._makeOne()
folder._setObject( 'acl_users', zcuf )
zcuf = folder._getOb( 'acl_users' )
sub = Folder()
sub._setId( 'sub' )
zcuf._setObject( 'sub', sub )
示例6: setUp
# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import _setId [as 别名]
def setUp(self):
self.root = Folder()
self.root.getPhysicalPath = lambda: ()
self.root.getPhysicalRoot = lambda r=self.root: r
self.root.composite_tool = CompositeTool()
self.tool = self.root.composite_tool
self.tool._check_security = 0
self.root.slot = Slot("slot")
self.slot = self.root.slot
f = Folder()
f._setId("f")
self.slot._setObject(f.id, f)
g = Folder()
g._setId("g")
self.slot._setObject(g.id, g)
self.root.otherslot = Slot("otherslot")
self.old_policy = setSecurityPolicy(PermissiveSecurityPolicy())
noSecurityManager()
示例7: setUp
# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import _setId [as 别名]
def setUp(self):
from AccessControl.SecurityManagement import noSecurityManager
from AccessControl.SecurityManager import setSecurityPolicy
from OFS.Folder import Folder
from Products.CompositePage.slot import Slot
from Products.CompositePage.tool import CompositeTool
self.root = Folder()
self.root.getPhysicalPath = lambda: ()
self.root.getPhysicalRoot = lambda r=self.root: r
self.root.composite_tool = CompositeTool()
self.tool = self.root.composite_tool
self.tool._check_security = 0
self.root.slot = Slot("slot")
self.slot = self.root.slot
f = Folder()
f._setId("f")
self.slot._setObject(f.id, f)
g = Folder()
g._setId("g")
self.slot._setObject(g.id, g)
self.root.otherslot = Slot("otherslot")
self.old_policy = setSecurityPolicy(PermissiveSecurityPolicy())
noSecurityManager()