Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed Jan 29, 2019
1 parent 24b7814 commit b94d697
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/Products/ZCatalog/tests/test_catalog.py
Expand Up @@ -221,6 +221,28 @@ def setUp(self):
self._catalog.catalogObject(dummy(self.nums[x]), repr(x))
self._catalog = self._catalog.__of__(dummy('foo'))

def _make_one(self, extra=None):
from Products.ZCatalog.Catalog import Catalog
catalog = Catalog()
catalog.lexicon = PLexicon('lexicon')

att1 = FieldIndex('att1')
catalog.addIndex('att1', att1)

att2 = ZCTextIndex('att2', caller=catalog,
index_factory=OkapiIndex, lexicon_id='lexicon')
catalog.addIndex('att2', att2)

att3 = KeywordIndex('att3')
catalog.addIndex('att3', att3)

if extra is not None:
extra(catalog)

for x in range(0, self.upper):
catalog.catalogObject(dummy(self.nums[x]), repr(x))
return catalog.__of__(dummy('foo'))

def test_clear(self):
catalog = self._make_one()
self.assertTrue(len(catalog) > 0)
Expand Down

0 comments on commit b94d697

Please sign in to comment.