[CMF-checkins] SVN: CMF/branches/1.5/C - When the CMFBTreeFolder
was moved into CMFCore, its base class was
Jens Vagelpohl
jens at dataflake.org
Sat Aug 6 09:48:57 EDT 2005
Log message for revision 37759:
- When the CMFBTreeFolder was moved into CMFCore, its base class was
changed to PortalFolderBase. This broke an assumption in the
portal_syndication tool that relied on all syndication containers
deriving from PortalFolder (http://www.zope.org/Collectors/CMF/369)
Changed:
U CMF/branches/1.5/CHANGES.txt
U CMF/branches/1.5/CMFDefault/SyndicationTool.py
U CMF/branches/1.5/CMFDefault/tests/test_SyndicationTool.py
-=-
Modified: CMF/branches/1.5/CHANGES.txt
===================================================================
--- CMF/branches/1.5/CHANGES.txt 2005-08-06 12:42:55 UTC (rev 37758)
+++ CMF/branches/1.5/CHANGES.txt 2005-08-06 13:48:57 UTC (rev 37759)
@@ -1,3 +1,13 @@
+After CMF 1.5.3-beta
+
+ Bugs fixed
+
+ - When the CMFBTreeFolder was moved into CMFCore, its base class was
+ changed to PortalFolderBase. This broke an assumption in the
+ portal_syndication tool that relied on all syndication containers
+ deriving from PortalFolder (http://www.zope.org/Collectors/CMF/369)
+
+
CMF 1.5.3-beta (2005/08/02)
Bugs Fixed
Modified: CMF/branches/1.5/CMFDefault/SyndicationTool.py
===================================================================
--- CMF/branches/1.5/CMFDefault/SyndicationTool.py 2005-08-06 12:42:55 UTC (rev 37758)
+++ CMF/branches/1.5/CMFDefault/SyndicationTool.py 2005-08-06 13:48:57 UTC (rev 37759)
@@ -27,7 +27,7 @@
from Products.CMFCore.ActionInformation import ActionInformation
from Products.CMFCore.ActionProviderBase import ActionProviderBase
from Products.CMFCore.Expression import Expression
-from Products.CMFCore.PortalFolder import PortalFolder
+from Products.CMFCore.PortalFolder import PortalFolderBase
from Products.CMFCore.utils import _checkPermission
from Products.CMFCore.utils import UniqueObject
@@ -244,12 +244,12 @@
def getSyndicatableContent(self, obj):
"""
An interface for allowing folderish items to implement an
- equivalent of PortalFolder.contentValues()
+ equivalent of PortalFolderBase.contentValues()
"""
if hasattr(obj, 'synContentValues'):
values = obj.synContentValues()
else:
- values = PortalFolder.contentValues(obj)
+ values = PortalFolderBase.contentValues(obj)
return values
security.declarePublic('buildUpdatePeriods')
Modified: CMF/branches/1.5/CMFDefault/tests/test_SyndicationTool.py
===================================================================
--- CMF/branches/1.5/CMFDefault/tests/test_SyndicationTool.py 2005-08-06 12:42:55 UTC (rev 37758)
+++ CMF/branches/1.5/CMFDefault/tests/test_SyndicationTool.py 2005-08-06 13:48:57 UTC (rev 37759)
@@ -134,6 +134,42 @@
self.failUnless(tool.isAllowed)
+ def test_getSyndicatableContent(self):
+ # http://www.zope.org/Collectors/CMF/369
+ # Make sure we use a suitable base class call when determining
+ # syndicatable content
+ try:
+ # This test only makes sense if CMFBTreeFolder is installed,
+ # which depends on the BTreeFolder2 product, which might not
+ # always be available.
+ from Products.CMFCore import CMFBTreeFolder
+ except ImportError:
+ return
+
+ from Products.CMFCore.PortalFolder import PortalFolder
+ from Products.CMFCore.CMFBTreeFolder import CMFBTreeFolder
+ from Products.CMFCore.TypesTool import TypesTool
+ PERIOD = 'hourly'
+ FREQUENCY = 4
+ NOW = DateTime()
+ MAX_ITEMS = 42
+
+ self.root._setObject( 'portal_types', TypesTool() )
+ self.root._setObject('pf', PortalFolder('pf'))
+ self.root._setObject('bf', CMFBTreeFolder('bf'))
+ self.root._setObject('portal_syndication', self._makeOne())
+ tool = self.root.portal_syndication
+ tool.editProperties(updatePeriod=PERIOD,
+ updateFrequency=FREQUENCY,
+ updateBase=NOW,
+ isAllowed=True,
+ max_items=MAX_ITEMS,
+ )
+
+ self.assertEqual(len(tool.getSyndicatableContent(self.root.pf)), 0)
+ self.assertEqual(len(tool.getSyndicatableContent(self.root.bf)), 0)
+
+
def test_suite():
return TestSuite((
makeSuite(SyndicationToolTests),
More information about the CMF-checkins
mailing list