provide separate method for default site setup, making it possible to create several loops sites in a unit/doc test
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@2654 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
		
							parent
							
								
									7a3d57fe5f
								
							
						
					
					
						commit
						9d0ab14f74
					
				
					 1 changed files with 7 additions and 3 deletions
				
			
		|  | @ -82,8 +82,6 @@ class TestSite(object): | ||||||
|         self.site = site |         self.site = site | ||||||
| 
 | 
 | ||||||
|     def baseSetup(self): |     def baseSetup(self): | ||||||
|         site = self.site |  | ||||||
| 
 |  | ||||||
|         #oldPolicy = setSecurityPolicy(ZopeSecurityPolicy) |         #oldPolicy = setSecurityPolicy(ZopeSecurityPolicy) | ||||||
|         oldPolicy = setSecurityPolicy(LoopsSecurityPolicy) |         oldPolicy = setSecurityPolicy(LoopsSecurityPolicy) | ||||||
|         checker = Checker(dict(title='zope.View', data='zope.View', body='zope.View'), |         checker = Checker(dict(title='zope.View', data='zope.View', body='zope.View'), | ||||||
|  | @ -159,13 +157,14 @@ class TestSite(object): | ||||||
|         component.provideAdapter(StatefulResourceIndexInfo) |         component.provideAdapter(StatefulResourceIndexInfo) | ||||||
|         component.provideHandler(handleTransition) |         component.provideHandler(handleTransition) | ||||||
| 
 | 
 | ||||||
|         loopsRoot = site['loops'] = Loops() |         loopsRoot = self.site['loops'] = Loops() | ||||||
|         setup = SetupManager(loopsRoot) |         setup = SetupManager(loopsRoot) | ||||||
|         concepts, resources, views = setup.setup() |         concepts, resources, views = setup.setup() | ||||||
|         return concepts, resources, views |         return concepts, resources, views | ||||||
| 
 | 
 | ||||||
|     def setup(self): |     def setup(self): | ||||||
|         concepts, resources, views = self.baseSetup() |         concepts, resources, views = self.baseSetup() | ||||||
|  | 
 | ||||||
|         catalog = component.getUtility(ICatalog) |         catalog = component.getUtility(ICatalog) | ||||||
| 
 | 
 | ||||||
|         tType = concepts.getTypeConcept() |         tType = concepts.getTypeConcept() | ||||||
|  | @ -189,6 +188,11 @@ class TestSite(object): | ||||||
|         self.indexAll(concepts, resources) |         self.indexAll(concepts, resources) | ||||||
|         return concepts, resources, views |         return concepts, resources, views | ||||||
| 
 | 
 | ||||||
|  |     def siteSetup(self, rootName='loops'): | ||||||
|  |         loopsRoot = self.site[rootName] = Loops() | ||||||
|  |         setup = SetupManager(loopsRoot) | ||||||
|  |         return setup.setup() | ||||||
|  | 
 | ||||||
|     def indexAll(self, concepts, resources): |     def indexAll(self, concepts, resources): | ||||||
|         for c in concepts.values(): |         for c in concepts.values(): | ||||||
|              self.catalog.index_doc(int(util.getUidForObject(c)), c) |              self.catalog.index_doc(int(util.getUidForObject(c)), c) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 helmutm
						helmutm