Skip to content

Commit

Permalink
Adapt tests
Browse files Browse the repository at this point in the history
With PLIP 1343 being merged some tests need to be adapted.

Now the catalog no longer processes indexing operations right away.

Some tests rely on that, so a minimal adaptation was needed.

References:
plone/Products.CMFPlone#1343
  • Loading branch information
gforcada committed Feb 21, 2017
1 parent 8d4306e commit 29f2396
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ New features:

Bug fixes:

- *add item here*
- Adapt tests to the new indexing operations queueing.
Part of PLIP 1343: https://github.com/plone/Products.CMFPlone/issues/1343
[gforcada]


3.3.4 (2016-12-30)
Expand Down
6 changes: 6 additions & 0 deletions plone/app/content/basecontent.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ ObjectManager one.
>>> 'my-item' in container.objectIds()
True
>>> del container['my-item']
>>> try:
... from Products.CMFCore.indexing import processQueue
... except ImportError:
... def processQueue():
... pass
>>> _ = processQueue()
>>> 'my-item' in container
False
>>> container._setObject('my-item', item)
Expand Down
7 changes: 7 additions & 0 deletions plone/app/content/tests/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
import os
import transaction

try:
from Products.CMFCore.indexing import processQueue
except ImportError:
def processQueue():
pass


_dir = os.path.dirname(__file__)

Expand Down Expand Up @@ -252,6 +258,7 @@ def testVocabularyEncoding(self):
self.portal.invokeFactory('Document', id="page", title="page")
self.portal.page.subject = (test_val,)
self.portal.page.reindexObject(idxs=['Subject'])
processQueue()

self.request.form['name'] = 'plone.app.vocabularies.Keywords'
results = getMultiAdapter(
Expand Down

0 comments on commit 29f2396

Please sign in to comment.