def setUp(self): import transaction from Testing.makerequest import makerequest from Testing.ZopeTestCase.ZopeLite import app transaction.begin() self.app = makerequest(app()) self.app.manage_addFolder('folder') p_disp = self.app.folder.manage_addProduct['SiteAccess'] p_disp.manage_addSiteRoot(title='SiteRoot', base='http://test_base', path='/test_path') self.app.REQUEST.set('PARENTS', [self.app]) self.app.REQUEST.traverse('/folder')
def setUp(self): import transaction from Testing.makerequest import makerequest from Testing.ZopeTestCase.ZopeLite import app transaction.begin() self.app = makerequest(app()) if 'virtual_hosting' not in self.app.objectIds(): # If ZopeLite was imported, we have no default virtual # host monster from Products.SiteAccess.VirtualHostMonster \ import manage_addVirtualHostMonster manage_addVirtualHostMonster(self.app, 'virtual_hosting') self.app.manage_addFolder('folder') self.app.folder.manage_addDTMLMethod('doc', '') self.app.REQUEST.set('PARENTS', [self.app]) self.traverse = self.app.REQUEST.traverse