Update of /cvs-repository/Products/PluginIndexes/DateIndex/tests In directory cvs.zope.org:/tmp/cvs-serv32028/lib/python/Products/PluginIndexes/DateIndex/tests
Modified Files: Tag: tseaver-hasattr_geddon-branch test_DateIndex.py Log Message: - Removed all uses of the 'hasattr' builtin from the core, where the object being tested derives (or might) from Persistent. XXX: currently, this branch imports a 'safe_hasattr' from ZODB.utils, which adds a dependency on ZODB for some packages; we probably need a better location, and perhas a C implementation? === Products/PluginIndexes/DateIndex/tests/test_DateIndex.py 1.5.2.4 => 1.5.2.4.28.1 === --- Products/PluginIndexes/DateIndex/tests/test_DateIndex.py:1.5.2.4 Thu Feb 5 12:49:02 2004 +++ Products/PluginIndexes/DateIndex/tests/test_DateIndex.py Sat May 28 20:41:32 2005 @@ -19,6 +19,7 @@ from Products.PluginIndexes.DateIndex.DateIndex import DateIndex, Local from types import IntType, FloatType import time +from ZODB.utils import safe_hasattr class Dummy: @@ -133,7 +134,7 @@ def _checkApply(self, req, expectedValues): result, used = self._index._apply_index(req) - if hasattr(result, 'keys'): + if safe_hasattr(result, 'keys'): result = result.keys() self.failUnlessEqual(used, ('date',)) self.failUnlessEqual(len(result), len(expectedValues), _______________________________________________ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins