Skip to content

Commit

Permalink
Fix testReindex to use _checkApply for search tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andbag committed May 20, 2016
1 parent 879cea0 commit a736c56
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Products/PluginIndexes/FieldIndex/tests.py
Expand Up @@ -208,18 +208,15 @@ def testNone(self):

def testReindex(self):
self._populateIndex()
result, used = self._index._apply_index({'foo': 'abc'})
assert list(result) == [2]
self._checkApply({'foo': 'abc'}, [self._values[2], ])
assert self._index.keyForDocument(2) == 'abc'
d = Dummy('world')
self._index.index_object(2, d)
result, used = self._index._apply_index({'foo': 'world'})
assert list(result) == [2]
self._checkApply({'foo': 'world'}, [(2, d), ])
assert self._index.keyForDocument(2) == 'world'
del d._foo
self._index.index_object(2, d)
result, used = self._index._apply_index({'foo': 'world'})
assert list(result) == []
self._checkApply({'foo': 'world'}, [])
try:
should_not_be = self._index.keyForDocument(2)
except KeyError:
Expand Down

0 comments on commit a736c56

Please sign in to comment.