[CMF-checkins] CVS: CMF/CMFUid/tests - test_uidhandling.py:1.4

Grégoire Weber zope.org at incept.ch
Thu Jul 22 09:44:37 EDT 2004


Update of /cvs-repository/CMF/CMFUid/tests
In directory cvs.zope.org:/tmp/cvs-serv14539/tests

Modified Files:
	test_uidhandling.py 
Log Message:
- removed setup of catalog indexes and metadata because the handler tool sets up the catalog tool on the first 'register'
- refactorings due to having moved annotation code to UniqueIdAnnotationTool.py


=== CMF/CMFUid/tests/test_uidhandling.py 1.3 => 1.4 ===
--- CMF/CMFUid/tests/test_uidhandling.py:1.3	Tue Jul 20 23:11:19 2004
+++ CMF/CMFUid/tests/test_uidhandling.py	Thu Jul 22 09:44:37 2004
@@ -31,17 +31,14 @@
 
 from Products.CMFUid.interfaces import IUniqueIdHandler
 from Products.CMFUid.UniqueIdGeneratorTool import UniqueIdGeneratorTool
+from Products.CMFUid.UniqueIdAnnotationTool import UniqueIdAnnotationTool
 from Products.CMFUid.UniqueIdHandlerTool import UniqueIdHandlerTool
 
-def setupIndexes(catalog, uid_attr_name):
+def removeUnnecessaryIndexes(catalog):
     indexes = [id[0] for id in catalog.enumerateIndexes()]
     columns = catalog.enumerateColumns()
     catalog.manage_delIndex(indexes)
     catalog.manage_delColumn(columns)
-    
-    catalog.addIndex(uid_attr_name, 'FieldIndex')
-    catalog.addColumn(uid_attr_name)
-
 
 class UniqueIdHandlerTests(SecurityTest):
 
@@ -49,10 +46,11 @@
         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'))
-        self.uid_attr_name = self.root.portal_uidhandler.UID_ATTRIBUTE_NAME
-        setupIndexes(self.root.portal_catalog, self.uid_attr_name)
+        
+        removeUnnecessaryIndexes(self.root.portal_catalog)
     
     def test_interface(self):
         handler = self.root.portal_uidhandler



More information about the CMF-checkins mailing list