[Zope-Checkins] CVS: Zope/lib/python/Products/ZCatalog/tests - testCatalog.py:1.12
Tres Seaver
tseaver@zope.com
Sat, 17 Nov 2001 05:26:52 -0500
Update of /cvs-repository/Zope/lib/python/Products/ZCatalog/tests
In directory cvs.zope.org:/tmp/cvs-serv21785/lib/python/Products/ZCatalog/tests
Modified Files:
testCatalog.py
Log Message:
- Try harder to reduce global side effects in the 'createDB' bit
(note that this piece of ugliness is due entirely to the hardwired
dependency on FieldIndex &c in ZCatalog's ctor; this should *go
away*!
- Move security manager handling to setUp/tearDown, to ensure exception-
safe cleanup.
=== Zope/lib/python/Products/ZCatalog/tests/testCatalog.py 1.11 => 1.12 ===
from ZODB.DB import DB
from Products.ZCatalog import ZCatalog,Vocabulary
-from Products.ZCatalog.Catalog import Catalog,CatalogError
+from Products.ZCatalog.Catalog import Catalog, CatalogError
import ExtensionClass
-from zLOG import LOG
from Products.PluginIndexes.FieldIndex.FieldIndex import FieldIndex
from Products.PluginIndexes.TextIndex.TextIndex import TextIndex
@@ -34,7 +33,8 @@
get_transaction().commit()
# Init products
- OFS.Application.initialize(app)
+ #OFS.Application.initialize(app)
+ OFS.Application.install_products(app) # XXX: this is still icky
return app
@@ -127,15 +127,15 @@
class dummy(ExtensionClass.Base):
pass
self.dummy = dummy()
+ newSecurityManager( None, DummyUser( 'phred' ) )
def tearDown(self):
+ noSecurityManager()
self.dummy = None
def testInstantiateWithoutVocab(self):
v = Vocabulary.Vocabulary('Vocabulary', 'Vocabulary', globbing=1)
- newSecurityManager( None, DummyUser( 'phred' ) )
zc = ZCatalog.ZCatalog('acatalog')
- noSecurityManager()
assert hasattr(zc, 'Vocabulary')
assert zc.getVocabulary().__class__ == v.__class__