[CMF-checkins] SVN: CMF/branches/2.0/C Issue #232: don't use fixed
schema for ActionInformation properties.
Tres Seaver
tseaver at palladion.com
Mon Sep 4 20:10:40 EDT 2006
Log message for revision 69965:
Issue #232: don't use fixed schema for ActionInformation properties.
Changed:
U CMF/branches/2.0/CHANGES.txt
U CMF/branches/2.0/CMFCore/ActionInformation.py
U CMF/branches/2.0/CMFCore/tests/test_ActionInformation.py
-=-
Modified: CMF/branches/2.0/CHANGES.txt
===================================================================
--- CMF/branches/2.0/CHANGES.txt 2006-09-04 21:19:43 UTC (rev 69964)
+++ CMF/branches/2.0/CHANGES.txt 2006-09-05 00:10:37 UTC (rev 69965)
@@ -2,6 +2,9 @@
Bug Fixes
+ - CMFCore.ActionInformation: don't use a fixed set of properties for
+ ActionInformation. (http://www.zope.org/Collectors/CMF/232/)
+
- CMFCore.CatalogTool: Use current executable's proxy roles, if any,
in place of user's roles when computing 'allowedRolesAndUsers' for
a query. (http://www.zope.org/Collectors/CMF/380)
Modified: CMF/branches/2.0/CMFCore/ActionInformation.py
===================================================================
--- CMF/branches/2.0/CMFCore/ActionInformation.py 2006-09-04 21:19:43 UTC (rev 69964)
+++ CMF/branches/2.0/CMFCore/ActionInformation.py 2006-09-05 00:10:37 UTC (rev 69965)
@@ -22,6 +22,7 @@
from Globals import InitializeClass
from OFS.ObjectManager import IFAwareObjectManager
from OFS.OrderedFolder import OrderedFolder
+from OFS.PropertyManager import PropertyManager
from OFS.SimpleItem import SimpleItem
from zope.i18nmessageid import Message
from zope.interface import implements
@@ -35,7 +36,6 @@
from utils import _checkPermission
from utils import _wwwdir
from utils import getToolByName
-from utils import SimpleItemWithProperties
_unchanged = [] # marker
@@ -69,7 +69,7 @@
InitializeClass(ActionCategory)
-class Action(SimpleItemWithProperties):
+class Action(PropertyManager, SimpleItem):
""" Reference to an action.
"""
@@ -99,6 +99,10 @@
'label': 'Visible?'},
)
+ manage_options = (
+ PropertyManager.manage_options
+ + SimpleItem.manage_options)
+
def __init__(self, id, **kw):
self.id = id
self._setPropValue( 'title', kw.get('title', '') )
Modified: CMF/branches/2.0/CMFCore/tests/test_ActionInformation.py
===================================================================
--- CMF/branches/2.0/CMFCore/tests/test_ActionInformation.py 2006-09-04 21:19:43 UTC (rev 69964)
+++ CMF/branches/2.0/CMFCore/tests/test_ActionInformation.py 2006-09-05 00:10:37 UTC (rev 69965)
@@ -97,7 +97,41 @@
['url', 'icon'] )
self.assertEqual( a.getInfoData(), WANTED )
+ def test_manage_propertiesForm_allows_adding(self):
+ from OFS.SimpleItem import SimpleItem
+ def _header(*args, **kw):
+ return 'HEADER'
+ def _footer(*args, **kw):
+ return 'HEADER'
+ container = SimpleItem()
+ container.REQUEST = request = DummyRequest()
+ request.set('manage_page_header', _header)
+ request.set('manage_page_footer', _footer)
+ request.set('BASEPATH1', '/one/two')
+ request.set('URL1', '/one/two')
+ request._steps = ['one', 'two']
+
+ prd = {'ac_permissions': ('a', 'b')}
+ container._getProductRegistryData = prd.get
+
+ a = self._makeOne('extensible').__of__(container)
+ form_html = a.manage_propertiesForm(request)
+
+ self.failUnless('value=" Add "' in form_html)
+
+class DummyRequest:
+ def __init__(self):
+ self._data = {}
+ def set(self, k, v):
+ self._data[k] = v
+ def get(self, k, default):
+ return self._data.get(k, default)
+ def __getitem__(self, k):
+ return self._data[k]
+ def __len__(self):
+ return len(self._data)
+
class ActionInfoTests(unittest.TestCase):
def _makeOne(self, *args, **kw):
More information about the CMF-checkins
mailing list