当前位置: 首页>>代码示例>>Python>>正文


Python Folder._setId方法代码示例

本文整理汇总了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() )
开发者ID:dtgit,项目名称:dtedu,代码行数:28,代码来源:test_tool.py

示例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' )
开发者ID:dtgit,项目名称:dtedu,代码行数:10,代码来源:test_tool.py

示例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
开发者ID:dtgit,项目名称:dtedu,代码行数:11,代码来源:test_tool.py

示例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
开发者ID:goschtl,项目名称:zope,代码行数:11,代码来源:test_tool.py

示例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 )
开发者ID:goschtl,项目名称:zope,代码行数:18,代码来源:test_PluggableAuthService.py

示例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()
开发者ID:goschtl,项目名称:zope,代码行数:20,代码来源:test_tool.py

示例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()
开发者ID:goschtl,项目名称:zope,代码行数:25,代码来源:test_tool.py


注:本文中的OFS.Folder.Folder._setId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。