Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(66)  |  Call(34)  |  Derive(2)  |  Import(30)

src/p/r/Products.CMFCore-2.2.8/Products/CMFCore/exportimport/tests/test_content.py   Products.CMFCore(Download)
def _makeFolder(id, site_folder=False):
    from Products.CMFCore.PortalFolder import PortalFolder
    from Products.CMFCore.TypesTool import TypesTool
    from Products.CMFCore.tests.base.dummy import DummyType
 
        def constructInstance(self, container, id, *args, **kw):
            portal_type = self._getId()
            if portal_type == TEST_FOLDER:
                content = PortalFolder(id)
            elif portal_type == TEST_CONTENT:
            return container._getOb(id)
 
    folder = PortalFolder(id)
    folder.portal_type = TEST_FOLDER
    if site_folder:

src/p/r/Products.CMFDefault-2.3.0-beta2/Products/CMFDefault/tests/test_SyndicationInfo.py   Products.CMFDefault(Download)
    def setUp(self):
        from zope.annotation.attribute import AttributeAnnotations
        from Products.CMFCore.interfaces import IFolderish
        from Products.CMFCore.PortalFolder import PortalFolder
 
        super(SyndicationInfoTests, self).setUp()
        self.app._setObject('portal', PortalFolder('portal'))
    def _makeOne(self):
        from zope.interface import alsoProvides
        from Products.CMFCore.PortalFolder import PortalFolder
        folder = PortalFolder('folder')
 

src/p/r/Products.CMFLDAP-1.0/Products/CMFLDAP/tests/test_LDAPMembershipTool.py   Products.CMFLDAP(Download)
 
from Products.CMFCore.tests.base.testcase import SecurityTest
from Products.CMFCore.PortalFolder import PortalFolder
from Products.CMFCore.tests.base.dummy import DummySite
from Products.CMFCore.tests.base.dummy import DummyTool
    def test_createMemberArea(self):
        site = self._makeSite()
        mtool = site.portal_membership
        members = site._setObject( 'Members', PortalFolder('Members') )
        acl_users = site._setObject( 'acl_users', LDAPDummyUserFolder() )
    def test_deleteMembers(self):
        site = self._makeSite()
        mtool = site.portal_membership
        members = site._setObject( 'Members', PortalFolder('Members') )
        acl_users = site._setObject( 'acl_users', LDAPDummyUserFolder() )

src/p/r/Products.CMFDefault-2.3.0-beta2/Products/CMFDefault/upgrade/tests/test_syndication_upgrade.py   Products.CMFDefault(Download)
 
from DateTime.DateTime import DateTime
from Products.CMFCore.PortalFolder import PortalFolder
from Products.CMFCore.interfaces import ISyndicationTool, IFolderish
from Products.CMFDefault.testing import FunctionalLayer
        syndication  = SyndicationTool()
        sm.registerUtility(syndication, ISyndicationTool)
        folder = PortalFolder("Dummy Portal Folder")
        self.folder = folder
 

src/p/r/Products.CMFDefault-2.3.0-beta2/Products/CMFDefault/tests/test_SyndicationTool.py   Products.CMFDefault(Download)
    def test_getSyndicatableContent(self):
        # http://www.zope.org/Collectors/CMF/369
        # Make sure we use a suitable base class call when determining
        # syndicatable content
        from Products.CMFCore.PortalFolder import PortalFolder
 
        getSiteManager().registerUtility(TypesTool(), ITypesTool)
        self.app._setObject('pf', PortalFolder('pf'))
        self.app._setObject('bf', CMFBTreeFolder('bf'))
        tool = self._makeOne()

src/p/r/Products.CMFDefault-2.3.0-beta2/Products/CMFDefault/tests/test_MembershipTool.py   Products.CMFDefault(Download)
 
from Products.CMFCore.interfaces import IWorkflowTool
from Products.CMFCore.PortalFolder import PortalFolder
from Products.CMFCore.tests.base.dummy import DummyFolder
from Products.CMFCore.tests.base.dummy import DummySite
        self.assertEqual(mtool.getHomeFolder(id='member_foo'), None)
        self.assertEqual(mtool.getHomeUrl(id='member_foo'), None)
        self.site._setObject('Members', PortalFolder('Members'))
        self.assertEqual(mtool.getHomeFolder(id='member_foo'), None)
        self.assertEqual(mtool.getHomeUrl(id='member_foo'), None)
        self.site.Members._setObject('member_foo', PortalFolder('member_foo'))
    def test_createMemberArea(self):
        mtool = self.site.portal_membership
        members = self.site._setObject( 'Members', PortalFolder('Members') )
        acl_users = self.site._setObject( 'acl_users', DummyUserFolder() )
        wtool = DummyTool()

src/p/r/Products.CMFDefault-2.3.0-beta2/Products/CMFDefault/browser/content/tests/test_folder.py   Products.CMFDefault(Download)
from Products.CMFCore.interfaces import ITypesTool
from Products.CMFCore.interfaces import IURLTool
from Products.CMFCore.PortalFolder import PortalFolder
from Products.CMFCore.tests.base.dummy import DummyContent
from Products.CMFCore.tests.base.dummy import DummySite
        sm.registerUtility(DummyTool().__of__(site), IURLTool)
        sm.registerUtility(DummyTool(), ITypesTool)
        folder = PortalFolder('test_folder')
        self.folder = site._setObject('test_folder', folder)
 
    def setUp(self):
        """Setup a site"""
        self.site = site = DummySite('site')
        folder = PortalFolder('test_folder')
        self.folder = site._setObject('test_folder', folder)

src/p/r/Products.LDAPUserFolder-2.27/Products/LDAPUserFolder/tests/test_LDAPMembershipTool.py   Products.LDAPUserFolder(Download)
try:
    from Products.CMFCore.tests.base.testcase import SecurityTest
    from Products.CMFCore.PortalFolder import PortalFolder
    from Products.CMFCore.tests.base.dummy import DummySite
    from Products.CMFCore.tests.base.dummy import DummyTool
    def test_createMemberArea(self):
        site = self._makeSite()
        mtool = site.portal_membership
        members = site._setObject( 'Members', PortalFolder('Members') )
        acl_users = site._setObject( 'acl_users', LDAPDummyUserFolder() )
    def test_deleteMembers(self):
        site = self._makeSite()
        mtool = site.portal_membership
        members = site._setObject( 'Members', PortalFolder('Members') )
        acl_users = site._setObject( 'acl_users', LDAPDummyUserFolder() )

src/p/r/Products.CMFCore-2.2.8/Products/CMFCore/tests/test_MembershipTool.py   Products.CMFCore(Download)
from Products.CMFCore.interfaces import ISiteRoot
from Products.CMFCore.MemberDataTool import MemberDataTool
from Products.CMFCore.PortalFolder import PortalFolder
from Products.CMFCore.tests.base.dummy import DummySite
from Products.CMFCore.tests.base.dummy import DummyTool
    def test_createMemberArea(self):
        site = self._makeSite()
        mtool = site.portal_membership
        members = site._setObject( 'Members', PortalFolder('Members') )
        acl_users = site._setObject( 'acl_users', DummyUserFolder() )
        site = self._makeSite( self.root.folder )
        mtool = site.portal_membership
        members = site._setObject( 'Members', PortalFolder('Members') )
        wtool = site._setObject( 'portal_workflow', DummyTool() )
 
        sm.registerUtility(site, ISiteRoot)
        mtool = site.portal_membership
        members = site._setObject( 'Members', PortalFolder('Members') )
        acl_users = site._setObject( 'acl_users', DummyUserFolder() )
        mdtool = site._setObject( 'portal_memberdata', MemberDataTool() )
        site = self._makeSite()
        mtool = site.portal_membership
        members = site._setObject( 'Members', PortalFolder('Members') )
        acl_users = site._setObject( 'acl_users', DummyUserFolder() )
        utool = site._setObject( 'portal_url', DummyTool() )

Previous  1 | 2