def setUp(self): SecurityRequestTest.setUp(self) setUpEvents() self.root._setObject('site', DummySite('site')) self.site = self.root.site self.acl_users = self.site._setObject('acl_users', DummyUserFolder())
def setUp(self): import Products.DCWorkflow setUpEvents() setUpTraversing() setUpGenericSetup() zcml.load_config('permissions.zcml', Products.Five) zcml.load_config('configure.zcml', Products.Five.browser) zcml.load_config('configure.zcml', Products.Five.skin) zcml.load_config('configure.zcml', Products.CMFCalendar) zcml.load_config('configure.zcml', Products.CMFCore) zcml.load_config('configure.zcml', Products.CMFDefault) zcml.load_config('configure.zcml', Products.DCWorkflow) self._oldSkindata = Skinnable.SKINDATA.copy() transaction.begin() app = self.app = ZopeTestCase.utils.makerequest(ZopeTestCase.app()) # Log in as a god :-) newSecurityManager( None, UnrestrictedUser('god', 'god', ['Manager'], '') ) factory = app.manage_addProduct['CMFDefault'].addConfiguredSite factory('CalendarTest', 'Products.CMFDefault:default', snapshot=False, extension_ids=('Products.CMFCalendar:default',)) self.Site = app.CalendarTest self.Tool = app.CalendarTest.portal_calendar # sessioning setup app.REQUEST.set_lazy( 'SESSION', app.session_data_manager.getSessionData )
def setUp(self): import Products.DCWorkflow SecurityRequestTest.setUp(self) setUpEvents() setUpTraversing() setUpGenericSetup() zcml.load_config('permissions.zcml', Products.Five) zcml.load_config('configure.zcml', Products.Five.browser) zcml.load_config('configure.zcml', Products.CMFCore) zcml.load_config('configure.zcml', Products.CMFDefault) zcml.load_config('configure.zcml', Products.DCWorkflow) try: factory = self.root.manage_addProduct[ 'CMFDefault'].addConfiguredSite factory('cmf', 'Products.CMFDefault:default', snapshot=False) self.site = self.root.cmf newSecurityManager(None, OmnipotentUser().__of__(self.site)) self.site.invokeFactory('File', id='file') self.site.portal_workflow.doActionFor(self.site.file, 'publish') self.site.invokeFactory('Image', id='image') self.site.portal_workflow.doActionFor(self.site.image, 'publish') self.site.invokeFactory('Folder', id='subfolder') self.subfolder = self.site.subfolder self.workflow = self.site.portal_workflow transaction.savepoint(optimistic=True) # Make sure we have _p_jars except: self.tearDown() raise
def setUp(self): import Products.DCWorkflow SecurityRequestTest.setUp(self) setUpEvents() setUpTraversing() setUpGenericSetup() zcml.load_config('permissions.zcml', Products.Five) zcml.load_config('configure.zcml', Products.Five.browser) zcml.load_config('configure.zcml', Products.CMFCore) zcml.load_config('configure.zcml', Products.CMFDefault) zcml.load_config('configure.zcml', Products.DCWorkflow) try: factory = self.root.manage_addProduct['CMFDefault'].addConfiguredSite factory('cmf', 'Products.CMFDefault:default', snapshot=False) self.site = self.root.cmf newSecurityManager(None, OmnipotentUser().__of__(self.site)) self.site.invokeFactory('File', id='file') self.site.portal_workflow.doActionFor(self.site.file, 'publish') self.site.invokeFactory('Image', id='image') self.site.portal_workflow.doActionFor(self.site.image, 'publish') self.site.invokeFactory('Folder', id='subfolder') self.subfolder = self.site.subfolder self.workflow = self.site.portal_workflow transaction.savepoint(optimistic=True) # Make sure we have _p_jars except: self.tearDown() raise
def setUp(self): SecurityRequestTest.setUp(self) setUpEvents() self.root._setObject('site', DummySite('site')) self.site = self.root.site self.acl_users = self.site._setObject('acl_users', DummyUserFolder())
def setUp(self): SecurityTest.setUp(self) setUpEvents() 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): 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): 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): import Products.DCWorkflow SecurityRequestTest.setUp(self) setUpEvents() setUpTraversing() setUpGenericSetup() zcml.load_config('permissions.zcml', Products.Five) zcml.load_config('configure.zcml', Products.Five.browser) zcml.load_config('configure.zcml', Products.CMFCore) zcml.load_config('configure.zcml', Products.CMFDefault) zcml.load_config('configure.zcml', Products.DCWorkflow)
def setUp(self): import Products.DCWorkflow SecurityRequestTest.setUp(self) setUpEvents() setUpTraversing() setUpGenericSetup() zcml.load_config('permissions.zcml', Products.Five) zcml.load_config('configure.zcml', Products.Five.browser) zcml.load_config('configure.zcml', Products.CMFCore) zcml.load_config('configure.zcml', Products.CMFDefault) zcml.load_config('configure.zcml', Products.DCWorkflow)
def setUp(self): from Products.CMFCore.PortalFolder import PortalFolder SecurityTest.setUp(self) setUpEvents() gsm = getGlobalSiteManager() gsm.provideUtility(IFactory, self._getTargetObject(), 'cmf.folder') self.site = DummySite('site').__of__(self.root) acl_users = self.site._setObject('acl_users', DummyUserFolder()) newSecurityManager(None, acl_users.all_powerful_Oz) ttool = self.site._setObject('portal_types', TypesTool()) ttool._setObject(self._PORTAL_TYPE, FTI(id=self._PORTAL_TYPE, title='Folder or Directory', meta_type=PortalFolder.meta_type, factory='cmf.folder', filter_content_types=0)) ttool._setObject('Dummy Content', FTI(**FTIDATA_DUMMY[0].copy())) self.f = self.site._setObject('container', PortalFolder('container')) self.f._setPortalTypeName(self._PORTAL_TYPE)
def setUp(self): from Products.CMFCore.PortalFolder import PortalFolder SecurityTest.setUp(self) setUpEvents() gsm = getGlobalSiteManager() gsm.provideUtility(IFactory, self._getTargetObject(), 'cmf.folder') self.site = DummySite('site').__of__(self.root) acl_users = self.site._setObject('acl_users', DummyUserFolder()) newSecurityManager(None, acl_users.all_powerful_Oz) ttool = self.site._setObject('portal_types', TypesTool()) ttool._setObject( self._PORTAL_TYPE, FTI(id=self._PORTAL_TYPE, title='Folder or Directory', meta_type=PortalFolder.meta_type, factory='cmf.folder', filter_content_types=0)) ttool._setObject('Dummy Content', FTI(**FTIDATA_DUMMY[0].copy())) self.f = self.site._setObject('container', PortalFolder('container')) self.f._setPortalTypeName(self._PORTAL_TYPE)
def setUp(self): SecurityTest.setUp(self) setUpEvents() 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): SecurityTest.setUp(self) setUpEvents() self.root._setObject('portal_uidannotation', self._getTargetClass()()) self.root._setObject('dummy', DummyContent(id='dummy'))
def setUp(self): SecurityTest.setUp(self) setUpEvents() self.root._setObject('portal_uidannotation', self._getTargetClass()()) self.root._setObject('dummy', DummyContent(id='dummy'))
def setUp(self): SecurityTest.setUp(self) setUpEvents() self.root._setObject( 'site', DummySite('site') ) self.site = self.root.site
def setUp(self): SecurityRequestTest.setUp(self) setUpEvents()
def setUp(self): SecurityTest.setUp(self) setUpEvents() self.site = DummySite('site').__of__(self.root)
def setUp(self): SecurityTest.setUp(self) setUpEvents() self.root._setObject('site', DummySite('site')) self.site = self.root.site