Skip to content

Commit

Permalink
Further test state reduction, tests take less than one second now :)
Browse files Browse the repository at this point in the history
  • Loading branch information
hannosch committed Apr 7, 2012
1 parent c0218b4 commit 043ea87
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/Products/ZCatalog/tests/test_catalog.py
Expand Up @@ -318,17 +318,13 @@ def _make_one(self, extra=None):
from Products.ZCatalog.Catalog import Catalog
catalog = Catalog()
catalog.lexicon = PLexicon('lexicon')
col1 = FieldIndex('col1')
att1 = FieldIndex('att1')
att2 = ZCTextIndex('att2', caller=catalog,
index_factory=OkapiIndex, lexicon_id='lexicon')
att3 = KeywordIndex('att3')
catalog.addIndex('att2', att2)
num = FieldIndex('num')

catalog.addIndex('col1', col1)
catalog.addIndex('att1', att1)
catalog.addIndex('att2', att2)
catalog.addIndex('att3', att3)
catalog.addIndex('num', num)
catalog.addColumn('num')

Expand Down Expand Up @@ -520,7 +516,10 @@ def test_search_not(self):
self.assertEqual(len(result), self.upper - 2)

def test_search_not_nothing(self):
catalog = self._make_one()
def extra(catalog):
col1 = FieldIndex('col1')
catalog.addIndex('col1', col1)
catalog = self._make_one(extra)
query = dict(att1='att1', col1={'not': 'col1'})
result = catalog(query)
self.assertEqual(len(result), 0)
Expand Down

0 comments on commit 043ea87

Please sign in to comment.