[Zope-Checkins] CVS: Zope/lib/python/Products/ZCatalog/tests - testCatalog.py:1.14

Casey Duncan casey@zope.com
Tue, 2 Jul 2002 15:54:34 -0400


Update of /cvs-repository/Zope/lib/python/Products/ZCatalog/tests
In directory cvs.zope.org:/tmp/cvs-serv3373/tests

Modified Files:
	testCatalog.py 
Log Message:
Restored behavior of ZCatalog when arguments with empty string are passed in. These values are effectively ignored by searchResults. If only empty values are passed, then it returns all results (assuming you passed an empty filter).

Removed "optimize" argument which was an attempt to "fix" searchResults for programmatic use. Also replaced comments this optimized behavior.

Eventually a new API will be added for "explicit" programmatic queries, for now we will suffer along with searchResults as it is. Extending it with additional dwim is not a path worth traveling.


=== Zope/lib/python/Products/ZCatalog/tests/testCatalog.py 1.13 => 1.14 ===
         a = self._catalog({})
         assert len(a) == upper, 'length should be %s, its %s'%(upper, len(a))
+        # Queries consisting of empty strings should do the same
+        a = self._catalog({'col1':'', 'col2':'', 'col3':''})
+        assert len(a) == upper, 'length should be %s, its %s'%(upper, len(a))
 
     def testFieldIndexLength(self):
         a = self._catalog(att1='att1')