[Checkins] SVN: Products.CMFCore/branches/miwa-catalog-adapter/Products/CMFCore/ fallback for BBB
Miles Waller
miles at jamkit.com
Wed Mar 18 07:16:15 EDT 2009
Log message for revision 98223:
fallback for BBB
Changed:
U Products.CMFCore/branches/miwa-catalog-adapter/Products/CMFCore/CatalogTool.py
U Products.CMFCore/branches/miwa-catalog-adapter/Products/CMFCore/tests/test_CatalogTool.py
-=-
Modified: Products.CMFCore/branches/miwa-catalog-adapter/Products/CMFCore/CatalogTool.py
===================================================================
--- Products.CMFCore/branches/miwa-catalog-adapter/Products/CMFCore/CatalogTool.py 2009-03-18 10:44:50 UTC (rev 98222)
+++ Products.CMFCore/branches/miwa-catalog-adapter/Products/CMFCore/CatalogTool.py 2009-03-18 11:16:14 UTC (rev 98223)
@@ -36,7 +36,7 @@
from Products.CMFCore.interfaces import ICatalogTool
from Products.CMFCore.interfaces import IIndexableObjectWrapper
from Products.CMFCore.interfaces import IIndexableObject
-from Products.CMFCore.interfaces import ICatalogAware
+from Products.CMFCore.interfaces import IContentish
from Products.CMFCore.permissions import AccessInactivePortalContent
from Products.CMFCore.permissions import ManagePortal
from Products.CMFCore.permissions import View
@@ -64,7 +64,7 @@
class IndexableObjectWrapper(object):
implements(IIndexableObjectWrapper, IIndexableObject)
- adapts(ICatalogAware, ICatalogTool)
+ adapts(IContentish, ICatalogTool)
__providedBy__ = IndexableObjectSpecification()
def __init__(self, ob, catalog):
Modified: Products.CMFCore/branches/miwa-catalog-adapter/Products/CMFCore/tests/test_CatalogTool.py
===================================================================
--- Products.CMFCore/branches/miwa-catalog-adapter/Products/CMFCore/tests/test_CatalogTool.py 2009-03-18 10:44:50 UTC (rev 98222)
+++ Products.CMFCore/branches/miwa-catalog-adapter/Products/CMFCore/tests/test_CatalogTool.py 2009-03-18 11:16:14 UTC (rev 98223)
@@ -23,7 +23,7 @@
from Products.CMFCore.interfaces import ICatalogTool
from Products.CMFCore.tests.base.dummy import DummyContent
from Products.CMFCore.interfaces import IIndexableObject
-from Products.CMFCore.interfaces import ICatalogAware
+from Products.CMFCore.interfaces import IContentish
from Products.CMFCore.tests.base.testcase import SecurityTest
@@ -49,16 +49,9 @@
and therefore does not need a wrapper to be registered
"""
- implements(IIndexableObject, ICatalogAware)
+ implements(IIndexableObject)
allowedRolesAndUsers = ['Manager'] # default value
-class CatalogDummyContent2(DummyContent):
-
- """ Dummy content that needs a wrapper to be registered
- """
-
- implements(ICatalogAware)
-
class IndexableObjectWrapperTests(unittest.TestCase):
def _getTargetClass(self):
@@ -113,20 +106,22 @@
def test_provided(self):
from Products.CMFCore.interfaces import IContentish
from Products.CMFCore.interfaces import IIndexableObjectWrapper
+ from Products.CMFCore.interfaces import IIndexableObject
obj = self._makeContent()
w = self._makeOne({}, obj)
self.failUnless(IContentish.providedBy(w))
self.failUnless(IIndexableObjectWrapper.providedBy(w))
+ self.failUnless(IIndexableObject.providedBy(w))
def test_adapts(self):
from zope.component import adaptedBy
- from Products.CMFCore.interfaces import ICatalogAware
+ from Products.CMFCore.interfaces import IContentish
from Products.CMFCore.interfaces import ICatalogTool
w = self._getTargetClass()
adapts = adaptedBy(w)
- self.assertEqual(adapts, (ICatalogAware, ICatalogTool))
+ self.assertEqual(adapts, (IContentish, ICatalogTool))
class CatalogToolTests(SecurityTest):
@@ -517,10 +512,10 @@
from zope.component import getSiteManager
self.sm = getSiteManager()
self.sm.registerAdapter( FakeWrapper
- , (ICatalogAware, ICatalogTool)
+ , (IContentish, ICatalogTool)
, IIndexableObject )
- dummy = CatalogDummyContent2(catalog=1)
+ dummy =DummyContent(catalog=1)
ctool = self._makeOne()
ctool.catalog_object(dummy, '/dummy')
self.assertEqual(1, len(ctool._catalog.searchResults()))
More information about the Checkins
mailing list