-
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Branch: refs/heads/master Date: 2017-02-21T22:14:58+01:00 Author: Gil Forcada (gforcada) <[email protected]> Commit: plone/plone.app.blob@e85355f Process indexing operations Part of PLIP: plone/Products.CMFPlone#1343 Files changed: M CHANGES.rst M src/plone/app/blob/tests/test_maintenance.py Repository: plone.app.blob Branch: refs/heads/master Date: 2017-02-21T22:15:55+01:00 Author: Gil Forcada Codinachs (gforcada) <[email protected]> Commit: plone/plone.app.blob@efcbd7b Merge pull request #27 from plone/merge-collective-indexing Merge collective indexing Files changed: M CHANGES.rst M src/plone/app/blob/tests/test_maintenance.py
- Loading branch information
Showing
1 changed file
with
73 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,165 +1,116 @@ | ||
Repository: Products.CMFUid | ||
Repository: plone.app.blob | ||
|
||
|
||
Branch: refs/heads/2.2 | ||
Date: 2016-11-07T23:23:54+01:00 | ||
Branch: refs/heads/master | ||
Date: 2017-02-21T22:14:58+01:00 | ||
Author: Gil Forcada (gforcada) <[email protected]> | ||
Commit: https://github.com/plone/Products.CMFUid/commit/c689dfc1bef3eca06ef1d8e30584f2e4d7e6a9ac | ||
Commit: https://github.com/plone/plone.app.blob/commit/e85355ff7352643d4574412a826632d381f6de5c | ||
|
||
Process indexing operations | ||
|
||
Part of PLIP: https://github.com/plone/Products.CMFPlone/issues/1343 | ||
|
||
The utility that processes the indexing operations was not registered. | ||
|
||
Files changed: | ||
M Products/CMFUid/CHANGES.txt | ||
M Products/CMFUid/tests/test_uidhandling.py | ||
|
||
diff --git a/Products/CMFUid/CHANGES.txt b/Products/CMFUid/CHANGES.txt | ||
index 863469e..1412343 100644 | ||
--- a/Products/CMFUid/CHANGES.txt | ||
+++ b/Products/CMFUid/CHANGES.txt | ||
@@ -4,6 +4,9 @@ Products.CMFUid Changelog | ||
2.2.2 (unreleased) | ||
------------------ | ||
M CHANGES.rst | ||
M src/plone/app/blob/tests/test_maintenance.py | ||
|
||
diff --git a/CHANGES.rst b/CHANGES.rst | ||
index ba237af..fd4a7a6 100644 | ||
--- a/CHANGES.rst | ||
+++ b/CHANGES.rst | ||
@@ -10,7 +10,9 @@ Breaking changes: | ||
|
||
New features: | ||
|
||
-- *add item here* | ||
+- Adapt tests to the new indexing operations queueing. | ||
+ Part of PLIP 1343: https://github.com/plone/Products.CMFPlone/issues/1343 | ||
+ [gforcada] | ||
|
||
2.2.1 (2010-07-04) | ||
------------------ | ||
diff --git a/Products/CMFUid/tests/test_uidhandling.py b/Products/CMFUid/tests/test_uidhandling.py | ||
index 3fd8aaf..f4f3949 100644 | ||
--- a/Products/CMFUid/tests/test_uidhandling.py | ||
+++ b/Products/CMFUid/tests/test_uidhandling.py | ||
@@ -29,6 +29,9 @@ | ||
from Products.CMFUid.interfaces import IUniqueIdGenerator | ||
from Products.CMFUid.interfaces import IUniqueIdHandler | ||
Bug fixes: | ||
|
||
+from Products.CMFCore.indexing import PortalCatalogProcessor | ||
+from Products.CMFCore.interfaces import IPortalCatalogQueueProcessor | ||
+ | ||
diff --git a/src/plone/app/blob/tests/test_maintenance.py b/src/plone/app/blob/tests/test_maintenance.py | ||
index a8c502d..6178de0 100644 | ||
--- a/src/plone/app/blob/tests/test_maintenance.py | ||
+++ b/src/plone/app/blob/tests/test_maintenance.py | ||
@@ -4,6 +4,12 @@ | ||
from Products.ATContentTypes.interface import file as atfile | ||
from Products.ATContentTypes.interface import image as atimage | ||
|
||
class DummyUid: | ||
"""A dummy uid that surely is of different type of the generated ones. | ||
@@ -71,6 +74,7 @@ def setUp(self): | ||
, IUniqueIdAnnotationManagement | ||
) | ||
sm.registerUtility(self.root.portal_uidgenerator, IUniqueIdGenerator) | ||
+ sm.registerUtility(provided=IPortalCatalogQueueProcessor, factory=PortalCatalogProcessor) | ||
|
||
# Make sure we have our indices/columns | ||
uid_name = self.root.portal_uidhandler.UID_ATTRIBUTE_NAME | ||
|
||
|
||
Repository: Products.CMFUid | ||
|
||
|
||
Branch: refs/heads/2.2 | ||
Date: 2017-02-21T22:03:40+01:00 | ||
Author: Gil Forcada (gforcada) <[email protected]> | ||
Commit: https://github.com/plone/Products.CMFUid/commit/f76c84c0a433010bc93f1f3858c98c1bd5d792b3 | ||
|
||
Conditional import | ||
|
||
This way, | ||
the package can be used in both 5.1 (with collective.indexing merged in CMFCore) | ||
and with 5.0 without it. | ||
|
||
Files changed: | ||
M Products/CMFUid/tests/test_uidhandling.py | ||
|
||
diff --git a/Products/CMFUid/tests/test_uidhandling.py b/Products/CMFUid/tests/test_uidhandling.py | ||
index f4f3949..a23b2bb 100644 | ||
--- a/Products/CMFUid/tests/test_uidhandling.py | ||
+++ b/Products/CMFUid/tests/test_uidhandling.py | ||
@@ -29,8 +29,12 @@ | ||
from Products.CMFUid.interfaces import IUniqueIdGenerator | ||
from Products.CMFUid.interfaces import IUniqueIdHandler | ||
|
||
-from Products.CMFCore.indexing import PortalCatalogProcessor | ||
-from Products.CMFCore.interfaces import IPortalCatalogQueueProcessor | ||
+try: | ||
+ from Products.CMFCore.indexing import PortalCatalogProcessor | ||
+ from Products.CMFCore.interfaces import IPortalCatalogQueueProcessor | ||
+ indexing = True | ||
+ from Products.CMFCore.indexing import processQueue | ||
+except ImportError: | ||
+ indexing = False | ||
|
||
|
||
class DummyUid: | ||
@@ -74,7 +78,9 @@ def setUp(self): | ||
, IUniqueIdAnnotationManagement | ||
) | ||
sm.registerUtility(self.root.portal_uidgenerator, IUniqueIdGenerator) | ||
- sm.registerUtility(provided=IPortalCatalogQueueProcessor, factory=PortalCatalogProcessor) | ||
+ def processQueue(): | ||
+ pass | ||
+ | ||
+ if indexing: | ||
+ sm.registerUtility(provided=IPortalCatalogQueueProcessor, factory=PortalCatalogProcessor) | ||
|
||
# Make sure we have our indices/columns | ||
uid_name = self.root.portal_uidhandler.UID_ATTRIBUTE_NAME | ||
class MaintenanceViewTests(ReplacementTestCase): | ||
|
||
@@ -38,6 +44,7 @@ def testUpdateTypeIndex(self): | ||
info = self.portal.portal_types.getTypeInfo('File') | ||
info.title = 'Foo' | ||
foo = self.folder[self.folder.invokeFactory('File', id='foo')] | ||
+ processQueue() | ||
info.title = 'File' | ||
# make sure it's actually wrong... | ||
catalog = self.portal.portal_catalog | ||
|
||
|
||
Repository: Products.CMFUid | ||
Repository: plone.app.blob | ||
|
||
|
||
Branch: refs/heads/2.2 | ||
Date: 2017-02-21T22:04:50+01:00 | ||
Branch: refs/heads/master | ||
Date: 2017-02-21T22:15:55+01:00 | ||
Author: Gil Forcada Codinachs (gforcada) <[email protected]> | ||
Commit: https://github.com/plone/Products.CMFUid/commit/39b9ffa959542713c2846a9385380566073e740a | ||
Commit: https://github.com/plone/plone.app.blob/commit/efcbd7bfd69ab4072bd53c368945681492db2ef9 | ||
|
||
Merge pull request #3 from plone/merge-collective-indexing | ||
Merge pull request #27 from plone/merge-collective-indexing | ||
|
||
Merge collective indexing | ||
|
||
Files changed: | ||
M Products/CMFUid/CHANGES.txt | ||
M Products/CMFUid/tests/test_uidhandling.py | ||
|
||
diff --git a/Products/CMFUid/CHANGES.txt b/Products/CMFUid/CHANGES.txt | ||
index 863469e..1412343 100644 | ||
--- a/Products/CMFUid/CHANGES.txt | ||
+++ b/Products/CMFUid/CHANGES.txt | ||
@@ -4,6 +4,9 @@ Products.CMFUid Changelog | ||
2.2.2 (unreleased) | ||
------------------ | ||
M CHANGES.rst | ||
M src/plone/app/blob/tests/test_maintenance.py | ||
|
||
diff --git a/CHANGES.rst b/CHANGES.rst | ||
index ba237af..fd4a7a6 100644 | ||
--- a/CHANGES.rst | ||
+++ b/CHANGES.rst | ||
@@ -10,7 +10,9 @@ Breaking changes: | ||
|
||
New features: | ||
|
||
-- *add item here* | ||
+- Adapt tests to the new indexing operations queueing. | ||
+ Part of PLIP 1343: https://github.com/plone/Products.CMFPlone/issues/1343 | ||
+ [gforcada] | ||
|
||
2.2.1 (2010-07-04) | ||
------------------ | ||
diff --git a/Products/CMFUid/tests/test_uidhandling.py b/Products/CMFUid/tests/test_uidhandling.py | ||
index 3fd8aaf..a23b2bb 100644 | ||
--- a/Products/CMFUid/tests/test_uidhandling.py | ||
+++ b/Products/CMFUid/tests/test_uidhandling.py | ||
@@ -29,6 +29,13 @@ | ||
from Products.CMFUid.interfaces import IUniqueIdGenerator | ||
from Products.CMFUid.interfaces import IUniqueIdHandler | ||
Bug fixes: | ||
|
||
diff --git a/src/plone/app/blob/tests/test_maintenance.py b/src/plone/app/blob/tests/test_maintenance.py | ||
index a8c502d..6178de0 100644 | ||
--- a/src/plone/app/blob/tests/test_maintenance.py | ||
+++ b/src/plone/app/blob/tests/test_maintenance.py | ||
@@ -4,6 +4,12 @@ | ||
from Products.ATContentTypes.interface import file as atfile | ||
from Products.ATContentTypes.interface import image as atimage | ||
|
||
+try: | ||
+ from Products.CMFCore.indexing import PortalCatalogProcessor | ||
+ from Products.CMFCore.interfaces import IPortalCatalogQueueProcessor | ||
+ indexing = True | ||
+ from Products.CMFCore.indexing import processQueue | ||
+except ImportError: | ||
+ indexing = False | ||
+ def processQueue(): | ||
+ pass | ||
+ | ||
|
||
class DummyUid: | ||
"""A dummy uid that surely is of different type of the generated ones. | ||
@@ -72,6 +79,9 @@ def setUp(self): | ||
) | ||
sm.registerUtility(self.root.portal_uidgenerator, IUniqueIdGenerator) | ||
class MaintenanceViewTests(ReplacementTestCase): | ||
|
||
+ if indexing: | ||
+ sm.registerUtility(provided=IPortalCatalogQueueProcessor, factory=PortalCatalogProcessor) | ||
+ | ||
# Make sure we have our indices/columns | ||
uid_name = self.root.portal_uidhandler.UID_ATTRIBUTE_NAME | ||
self.root.portal_catalog.addIndex(uid_name, 'FieldIndex') | ||
@@ -38,6 +44,7 @@ def testUpdateTypeIndex(self): | ||
info = self.portal.portal_types.getTypeInfo('File') | ||
info.title = 'Foo' | ||
foo = self.folder[self.folder.invokeFactory('File', id='foo')] | ||
+ processQueue() | ||
info.title = 'File' | ||
# make sure it's actually wrong... | ||
catalog = self.portal.portal_catalog | ||
|
||
|