Commit 38328ef3 authored by Zachery Bir's avatar Zachery Bir

Brought forward from the Zope 2.7 branch:

  - deleted trailing whitespace

  - new test for removal (indexing an object with a value of None
    should remove it from the index)
parent aafe54a7
...@@ -239,6 +239,20 @@ class DI_Tests(unittest.TestCase): ...@@ -239,6 +239,20 @@ class DI_Tests(unittest.TestCase):
val = (((yr * 12 + mo) * 31 + dy) * 24 + hr) * 60 + mn val = (((yr * 12 + mo) * 31 + dy) * 24 + hr) * 60 + mn
self.failUnlessEqual(self._index.getEntryForObject(k), val) self.failUnlessEqual(self._index.getEntryForObject(k), val)
def test_removal(self):
""" DateIndex would hand back spurious entries when used as a
sort_index, because it previously was not removing entries
from the _unindex when indexing an object with a value of
None. The catalog consults a sort_index's
documentToKeyMap() to build the brains.
"""
values = self._values
index = self._index
self._populateIndex()
self._checkApply(self._int_req, [values[7]])
index.index_object(7, None)
self.failIf(7 in index.documentToKeyMap().keys())
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment