def setUp( self ): SecurityTest.setUp(self) self.site = DummySite('site').__of__(self.root) self.acl_users = self.site._setObject( 'acl_users', DummyUserFolder() ) self.ttool = self.site._setObject( 'portal_types', TypesTool() ) fti = FTIDATA_DUMMY[0].copy() self.ttool._setObject( 'Dummy Content', FTI(**fti) )
def setUp(self): from Products.CMFUid.UniqueIdAnnotationTool \ import UniqueIdAnnotationTool SecurityTest.setUp(self) self.root._setObject('portal_uidannotation', UniqueIdAnnotationTool()) self.root._setObject('dummy', DummyContent(id='dummy'))
def setUp(self): self._trap_warning_output() SecurityTest.setUp(self) self.site = DummySite('site').__of__(self.root) sm = getSiteManager() sm.registerUtility(DummyTool(), IMembershipTool) sm.registerUtility(DummyTool().__of__(self.site), IURLTool)
def setUp(self): from Products.CMFCore.PortalFolder import PortalFolderFactory SecurityTest.setUp(self) gsm = getGlobalSiteManager() gsm.registerUtility(PortalFolderFactory, IFactory, 'cmf.folder') self.site = DummySite('site').__of__(self.root)
def setUp(self): SecurityTest.setUp(self) # setting up types tool getSiteManager().registerUtility(TypesTool(), ITypesTool) # setup portal try: self.app._delObject('test') except AttributeError: pass self.app._setObject('test', PortalFolder('test', '')) self.test = test = self.app.test # setting up folders test._setObject('folder', PortalFolder('folder', '')) folder = self.folder = test.folder folder._setObject('sub', PortalFolder('sub', '')) sub = self.sub = folder.sub #----- hacks to allow pasting (see also test_PortalFolder) # WAAA! force sub to allow paste of Dummy object. sub.all_meta_types = extra_meta_types() # delete items if necessary try: folder._delObject('dummy') except AttributeError: pass try: sub._delObject('dummy') except AttributeError: pass
def setUp( self ): SecurityTest.setUp(self) root = self.root try: root._delObject('test') except AttributeError: pass root._setObject( 'test', PortalFolder( 'test','' ) )
def setUp(self): SecurityTest.setUp(self) root = self.root # setting up types tool root._setObject( 'portal_types', TypesTool() ) # setup portal try: root._delObject('test') except AttributeError: pass root._setObject('test', PortalFolder('test', '')) self.test = test = self.root.test # setting up folders test._setObject( 'folder', PortalFolder( 'folder', '' ) ) folder = self.folder = test.folder folder._setObject( 'sub', PortalFolder( 'sub', '' ) ) sub = self.sub = folder.sub #----- hacks to allow pasting (see also test_PortalFolder) # WAAA! force sub to allow paste of Dummy object. sub.all_meta_types = extra_meta_types() # delete items if necessary try: folder._delObject('dummy') except AttributeError: pass try: sub._delObject('dummy') except AttributeError: pass
def setUp(self): from Products.CMFCore.CatalogTool import CatalogTool from Products.CMFCore.utils import registerToolInterface from Products.CMFUid.interfaces import IUniqueIdHandler from Products.CMFUid.UniqueIdAnnotationTool \ import UniqueIdAnnotationTool from Products.CMFUid.UniqueIdGeneratorTool \ import UniqueIdGeneratorTool SecurityTest.setUp(self) self.app._setObject('dummy', DummyContent(id='dummy')) self.app._setObject('dummy2', DummyContent(id='dummy2')) self.ctool = CatalogTool().__of__(self.app) self.uidhandler = self._makeOne() sm = getSiteManager() sm.registerUtility(self.ctool, ICatalogTool) registerToolInterface('portal_catalog', ICatalogTool) sm.registerUtility(self.uidhandler, IUniqueIdHandler) sm.registerUtility(UniqueIdAnnotationTool(), IUniqueIdAnnotationManagement) sm.registerUtility(UniqueIdGeneratorTool(), IUniqueIdGenerator) sm.registerUtility(provided=IPortalCatalogQueueProcessor, factory=PortalCatalogProcessor) # Make sure we have our indices/columns uid_name = self.uidhandler.UID_ATTRIBUTE_NAME self.ctool.addIndex(uid_name, 'FieldIndex') self.ctool.addColumn(uid_name)
def setUp(self): SecurityTest.setUp(self) self.site = DummySite('site') sm = getSiteManager() self.site._setObject( 'portal_discussion', self._makeOne() ) sm.registerUtility(self.site.portal_discussion, IDiscussionTool) self.site._setObject( 'portal_types', DummyTool() )
def setUp(self): SecurityTest.setUp(self) self.root._setObject('portal_catalog', CatalogTool()) self.root._setObject('portal_uidgenerator', UniqueIdGeneratorTool()) self.root._setObject('portal_uidhandler', UniqueIdHandlerTool()) self.root._setObject('dummy', DummyContent(id='dummy')) self.uid_attr_name = self.root.portal_uidhandler._UID_ATTRIBUTE_NAME setupIndexes(self.root.portal_catalog, self.uid_attr_name)
def setUp(self): SecurityTest.setUp(self) newSecurityManager(None, DummyUser().__of__(self.app.acl_users)) self.site = DummySite('site').__of__(self.root) sm = getSiteManager() self.site._setObject( 'portal_discussion', DiscussionTool() ) sm.registerUtility(self.site.portal_discussion, IDiscussionTool) self.site._setObject( 'portal_types', TypesTool() )
def setUp( self ): from Products.CMFCore.PortalFolder import PortalFolder SecurityTest.setUp(self) root = self.root try: root._delObject('test') except AttributeError: pass root._setObject( 'test', PortalFolder( 'test','' ) )
def setUp(self): SecurityTest.setUp(self) self.site = DummySite('site').__of__(self.root) sm = getSiteManager() self.site._setObject( 'portal_discussion', DiscussionTool() ) sm.registerUtility(self.site.portal_discussion, IDiscussionTool) self.site._setObject( 'portal_membership', DummyTool() ) self.site._setObject( 'portal_types', TypesTool() )
def setUp(self): from Products.CMFCore.interfaces import IPropertiesTool SecurityTest.setUp(self) self.site = PropertiedDummySite('site') sm = getSiteManager() sm.registerUtility(MailHost('MailHost'), IMailHost) sm.registerUtility(self._makeOne(), IPropertiesTool) sm.registerUtility(self.site, ISiteRoot)
def setUp( self ): SecurityTest.setUp(self) filterwarnings('ignore', category=DeprecationWarning) self.site = DummySite('site').__of__(self.root) self.acl_users = self.site._setObject( 'acl_users', DummyUserFolder() ) self.ttool = self.site._setObject( 'portal_types', TypesTool() ) fti = FTIDATA_DUMMY[0].copy() self.ttool._setObject( 'Dummy Content', FTI(**fti) )
def setUp(self): SecurityTest.setUp(self) self.site = PropertiedDummySite('site') sm = getSiteManager() sm.registerUtility(self.site, ISiteRoot) self.site._setObject('portal_properties', self._makeOne()) sm.registerUtility(self.site.portal_properties, IPropertiesTool) self.site._setObject('MailHost', MailHost('MailHost')) sm.registerUtility(self.site.MailHost, IMailHost)
def setUp(self): SecurityTest.setUp(self) gsm = getGlobalSiteManager() gsm.provideUtility(IFactory, DummyFactory, 'test.dummy') self.f = DummyFolder() self.ti = self._makeOne('Foo', meta_type='Dummy', factory='test.dummy') newSecurityManager(None, UserWithRoles('FooAdder').__of__(self.f))
def setUp(self): SecurityTest.setUp(self) newSecurityManager(None, DummyUser().__of__(self.app.acl_users)) self.site = DummySite('site').__of__(self.app) self.dtool = DiscussionTool() self.ttool = TypesTool() sm = getSiteManager() sm.registerUtility(self.dtool, IDiscussionTool) sm.registerUtility(self.ttool, ITypesTool)
def setUp(self): SecurityTest.setUp(self) self.root._setObject('portal_catalog', CatalogTool()) self.root._setObject('portal_uidgenerator', UniqueIdGeneratorTool()) self.root._setObject('portal_uidannotation', UniqueIdAnnotationTool()) self.root._setObject('portal_uidhandler', UniqueIdHandlerTool()) self.root._setObject('dummy', DummyContent(id='dummy')) removeUnnecessaryIndexes(self.root.portal_catalog)
def setUp(self): SecurityTest.setUp(self) sm = getSiteManager() sm.registerUtility(DummyFactory, IFactory, 'test.dummy') self.f = DummyFolder() self.ti = self._makeOne('Foo', meta_type='Dummy', factory='test.dummy') newSecurityManager(None, UserWithRoles('FooAdder').__of__(self.f))
def setUp(self): from Products.CMFCore.TypesTool import FactoryTypeInformation as FTI SecurityTest.setUp(self) self.site = DummySite('site').__of__(self.root) self.acl_users = self.site._setObject( 'acl_users', DummyUserFolder() ) self.ttool = self.site._setObject( 'portal_types', self._makeOne() ) fti = FTIDATA_DUMMY[0].copy() self.ttool._setObject( 'Dummy Content', FTI(**fti) )
def setUp(self): SecurityTest.setUp(self) self.root._setObject('portal_uidannotation', self._getTargetClass()()) self.root._setObject('dummy', DummyContent(id='dummy')) sm = getSiteManager() sm.registerUtility( self.root.portal_uidannotation , IUniqueIdAnnotationManagement )
def setUp(self): SecurityTest.setUp(self) self.root._setObject('site', DummySite('site') ) self.site = self.root._getOb('site') self.site._setObject( 'portal_types', DummyTool() ) self.site._setObject( 'portal_workflow', WorkflowTool() ) self._constructDummyWorkflow() transaction.savepoint(optimistic=True) newSecurityManager(None, OmnipotentUser().__of__(self.site))
def setUp(self): from Products.CMFCore.interfaces import IDiscussionTool SecurityTest.setUp(self) self.site = DummySite('site') self.dtool = self._makeOne() self.ttool = DummyTool() sm = getSiteManager() sm.registerUtility(self.dtool, IDiscussionTool) sm.registerUtility(self.ttool, ITypesTool)
def setUp(self): import Products from Products.CMFCore.PortalFolder import PortalFolderFactory SecurityTest.setUp(self) setUpEvents() zcml.load_config('permissions.zcml', Products.Five) zcml.load_config('content.zcml', Products.CMFCore) gsm = getGlobalSiteManager() gsm.provideUtility(IFactory, PortalFolderFactory, 'cmf.folder') self.site = DummySite('site').__of__(self.root)
def setUp(self): SecurityTest.setUp(self) self.app._setObject('site', DummySite('site')) self.site = self.app._getOb('site') self.wtool = self.site._setObject('portal_workflow', WorkflowTool()) self._constructDummyWorkflow() transaction.savepoint(optimistic=True) newSecurityManager(None, OmnipotentUser().__of__(self.site)) sm = getSiteManager() sm.registerUtility(self.wtool, IWorkflowTool) sm.registerUtility(DummyTool(), ITypesTool)
def setUp(self): SecurityTest.setUp(self) self.site = DummySite('site').__of__(self.app) ttool = TypesTool() fti = FTIDATA_CMF[0].copy() ttool._setObject( 'Dummy Content 15', FTI(**fti) ) self.site._setObject( 'foo', DummyContent() ) sm = getSiteManager() sm.registerUtility(DummyTool(), IMembershipTool) sm.registerUtility(DummyTool().__of__(self.site), IURLTool) sm.registerUtility(ttool, ITypesTool)
def setUp(self): from Products.CMFCore.interfaces import IActionsTool SecurityTest.setUp(self) self.tool = self._makeOne() self.tool.action_providers = ('portal_actions',) self.app._setObject('foo', URLTool()) sm = getSiteManager() sm.registerUtility(self.tool, IActionsTool) sm.registerUtility(MembershipTool(), IMembershipTool) sm.registerUtility(self.app, ISiteRoot) sm.registerUtility(URLTool(), IURLTool)
def setUp(self): from Products.CMFCore.CatalogTool import CatalogTool from Products.CMFUid.UniqueIdAnnotationTool \ import UniqueIdAnnotationTool from Products.CMFUid.UniqueIdGeneratorTool \ import UniqueIdGeneratorTool SecurityTest.setUp(self) self.root._setObject('portal_catalog', CatalogTool()) self.root._setObject('portal_uidgenerator', UniqueIdGeneratorTool()) self.root._setObject('portal_uidannotation', UniqueIdAnnotationTool()) self.root._setObject('portal_uidhandler', self._getTargetClass()()) self.root._setObject('dummy', DummyContent(id='dummy')) self.root._setObject('dummy2', DummyContent(id='dummy2'))
def setUp(self): from Products.CMFUid.interfaces import IUniqueIdAnnotationManagement SecurityTest.setUp(self) self.uidannotation = self._makeOne() sm = getSiteManager() sm.registerUtility(self.uidannotation, IUniqueIdAnnotationManagement) sm.registerUtility(DummyUniqueIdHandlerTool(), IUniqueIdHandler) self.app._setObject('dummy', DummyContent(id='dummy')) self.app._setObject('site', Folder('site')) transaction.savepoint(optimistic=True)
def tearDown(self): SecurityTest.tearDown(self) FSPTMaker.tearDown(self)
def tearDown(self): SecurityTest.tearDown(self) FSDTMLMaker.tearDown(self)
def tearDown(self): del filters[0] SecurityTest.tearDown(self)
def tearDown(self): from zope.testing.cleanup import cleanUp cleanUp() SecurityTest.tearDown(self)
def setUp(self): SecurityTest.setUp(self) self.site = DummySite('site').__of__(self.root)
def tearDown(self): cleanUp() SecurityTest.tearDown(self) FSPTMaker.tearDown(self)
def tearDown(self): cleanUp() SecurityTest.tearDown(self)
def setUp(self): SecurityTest.setUp(self) self.site = DummySite('site').__of__(self.root) self.site._setObject('portal_membership', self._makeOne())
def tearDown(self): SecurityTest.tearDown(self) FSZSQLMaker.tearDown(self)
def tearDown(self): cleanUp() FSReSTMaker.tearDown(self) SecurityTest.tearDown(self)
def setUp(self): SecurityTest.setUp(self) FSPSMaker.setUp(self) self._trap_warning_output()
def tearDown(self): self._free_warning_output() FSPSMaker.tearDown(self) SecurityTest.tearDown(self)
def setUp(self): FSPSMaker.setUp(self) SecurityTest.setUp(self)
def setUp(self): SecurityTest.setUp(self) self.site = DummySite('site').__of__(self.root) self.site._setObject('portal_discussion', DiscussionTool()) self.site._setObject('portal_membership', DummyTool()) self.site._setObject('portal_types', TypesTool())
def setUp(self): SecurityTest.setUp(self) self.site = DummySite('site').__of__(self.root) self.mtool = MembershipTool().__of__(self.site)
def setUp(self): FSDVTest.setUp(self) SecurityTest.setUp(self)
def setUp(self): SecurityTest.setUp(self) self.root._setObject('site', DummySite('site')) self.site = self.root.site
def tearDown(self): SecurityTest.tearDown(self) FSDVTest.tearDown(self)
def setUp(self): SecurityTest.setUp(self) self.root._setObject('portal_uidgenerator', self._getTargetClass()())
def setUp(self): SecurityTest.setUp(self) self.root._setObject('portal_uidannotation', self._getTargetClass()()) self.root._setObject('dummy', DummyContent(id='dummy'))
def tearDown(self): cleanUp() FSSTXMaker.tearDown(self) SecurityTest.tearDown(self) _TemplateSwitcher.tearDown(self)
def xxx_setUp(self): SecurityTest.setUp(self)
def setUp(self): SecurityTest.setUp(self) self.site = DummySite('site').__of__(self.root) self.site._setObject( 'acl_users', DummyUserFolder() ) self.site._setObject('content_dummy', DummyObject(id='content_dummy')) self.site._setObject('actions_dummy', DummyObject(id='actions_dummy'))
def tearDown(self): SecurityTest.tearDown(self) self._free_warning_output()
def setUp(self): SecurityTest.setUp(self) self.site = DummySite('site').__of__(self.app) sm = getSiteManager() sm.registerUtility(DummyMembershipTool(), IMembershipTool)
def setUp(self): FSPTMaker.setUp(self) SecurityTest.setUp(self) self.skins, self.custom, self.fsdir, self.fsPT = self._makeContext( 'testPT', 'testPT.pt')