[Zope-Checkins] CVS: Products/PluginIndexes/FieldIndex/tests -
testFieldIndex.py:1.6.68.2.24.1
Tres Seaver
tseaver at palladion.com
Sat May 28 20:42:12 EDT 2005
Update of /cvs-repository/Products/PluginIndexes/FieldIndex/tests
In directory cvs.zope.org:/tmp/cvs-serv32028/lib/python/Products/PluginIndexes/FieldIndex/tests
Modified Files:
Tag: tseaver-hasattr_geddon-branch
testFieldIndex.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/FieldIndex/tests/testFieldIndex.py 1.6.68.2 => 1.6.68.2.24.1 ===
--- Products/PluginIndexes/FieldIndex/tests/testFieldIndex.py:1.6.68.2 Fri Apr 23 10:29:24 2004
+++ Products/PluginIndexes/FieldIndex/tests/testFieldIndex.py Sat May 28 20:41:32 2005
@@ -14,6 +14,7 @@
import os, sys, unittest
import ZODB
+from ZODB.utils import safe_hasattr
from Products.PluginIndexes.FieldIndex.FieldIndex import FieldIndex
class Dummy:
@@ -80,7 +81,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()
assert used == ( 'foo', )
assert len( result ) == len( expectedValues ), \
More information about the Zope-Checkins
mailing list