[CMF-checkins] SVN: CMF/trunk/CMFCore/ - added missing 'pghandler'
argument (http://www.zope.org/Collectors/CMF/379)
Yvo Schubbe
y.2005- at wcm-solutions.de
Sat Sep 3 09:40:58 EDT 2005
Log message for revision 38290:
- added missing 'pghandler' argument (http://www.zope.org/Collectors/CMF/379)
Changed:
U CMF/trunk/CMFCore/CatalogTool.py
U CMF/trunk/CMFCore/tests/test_CatalogTool.py
-=-
Modified: CMF/trunk/CMFCore/CatalogTool.py
===================================================================
--- CMF/trunk/CMFCore/CatalogTool.py 2005-09-03 13:40:17 UTC (rev 38289)
+++ CMF/trunk/CMFCore/CatalogTool.py 2005-09-03 13:40:57 UTC (rev 38290)
@@ -103,8 +103,8 @@
#
# Subclass extension interface
#
- security.declarePublic( 'enumerateIndexes' ) # Subclass can call
- def enumerateIndexes( self ):
+ security.declarePublic('enumerateIndexes') # Subclass can call
+ def enumerateIndexes(self):
# Return a list of ( index_name, type, extra ) tuples for the initial
# index set.
plaintext_extra = SimpleRecord( lexicon_id='plaintext_lexicon'
@@ -148,8 +148,8 @@
)
)
- security.declarePublic( 'enumerateColumns' )
- def enumerateColumns( self ):
+ security.declarePublic('enumerateColumns')
+ def enumerateColumns(self):
# Return a sequence of schema names to be cached.
return ( 'Subject'
, 'Title'
@@ -198,7 +198,7 @@
# 'portal_catalog' interface methods
#
- def _listAllowedRolesAndUsers( self, user ):
+ def _listAllowedRolesAndUsers(self, user):
result = list( user.getRoles() )
result.append( 'Anonymous' )
result.append( 'user:%s' % user.getId() )
@@ -294,7 +294,8 @@
manage_catalogFind = DTMLFile( 'catalogFind', _dtmldir )
- def catalog_object(self, obj, uid, idxs=None, update_metadata=1):
+ def catalog_object(self, obj, uid=None, idxs=None, update_metadata=1,
+ pghandler=None):
# Wraps the object with workflow and accessibility
# information just before cataloging.
wftool = getToolByName(self, 'portal_workflow', None)
@@ -303,19 +304,20 @@
else:
vars = {}
w = IndexableObjectWrapper(vars, obj)
- ZCatalog.catalog_object(self, w, uid, idxs, update_metadata)
+ ZCatalog.catalog_object(self, w, uid, idxs, update_metadata,
+ pghandler)
security.declarePrivate('indexObject')
def indexObject(self, object):
- '''Add to catalog.
- '''
+ """Add to catalog.
+ """
url = self.__url(object)
self.catalog_object(object, url)
security.declarePrivate('unindexObject')
def unindexObject(self, object):
- '''Remove from catalog.
- '''
+ """Remove from catalog.
+ """
url = self.__url(object)
self.uncatalog_object(url)
Modified: CMF/trunk/CMFCore/tests/test_CatalogTool.py
===================================================================
--- CMF/trunk/CMFCore/tests/test_CatalogTool.py 2005-09-03 13:40:17 UTC (rev 38289)
+++ CMF/trunk/CMFCore/tests/test_CatalogTool.py 2005-09-03 13:40:57 UTC (rev 38290)
@@ -24,6 +24,7 @@
from DateTime import DateTime
from Products.CMFCore.tests.base.dummy import DummyContent
+from Products.CMFCore.tests.base.dummy import DummySite
from Products.CMFCore.tests.base.security import OmnipotentUser
from Products.CMFCore.tests.base.security import UserWithRoles
from Products.CMFCore.tests.base.testcase import SecurityTest
@@ -84,7 +85,7 @@
user = OmnipotentUser().__of__(self.root)
newSecurityManager(None, user)
- def test_processActions( self ):
+ def test_processActions(self):
"""
Tracker #405: CatalogTool doesn't accept optional third
argument, 'idxs', to 'catalog_object'.
@@ -289,11 +290,25 @@
convert(kw)
self.assertEqual(kw, {'expires': {'query': (5,7), 'range': 'min:max'}})
+ def test_refreshCatalog(self):
+ site = DummySite('site').__of__(self.root)
+ site._setObject('dummy', DummyContent(catalog=1))
+ site._setObject('portal_catalog', self._makeOne())
+ ctool = site.portal_catalog
+ ctool.catalog_object(site.dummy, '/dummy')
+ self.assertEqual(1, len(ctool._catalog.searchResults()))
+ ctool.refreshCatalog(clear=1)
+ self.assertEqual(1, len(ctool._catalog.searchResults()),
+ 'CMF Collector issue #379 (\'Update Catalog\' '
+ 'fails): %s entries after refreshCatalog'
+ % (len(ctool._catalog.searchResults()),))
+
+
def test_suite():
return TestSuite((
- makeSuite( IndexableObjectWrapperTests ),
- makeSuite( CatalogToolTests ),
+ makeSuite(IndexableObjectWrapperTests),
+ makeSuite(CatalogToolTests),
))
if __name__ == '__main__':
More information about the CMF-checkins
mailing list