[CMF-checkins] CVS: Products/CMFCore/tests -
test_ActionInformation.py:1.9 test_ActionProviderBase.py:1.14
Grégoire Weber
zope.org at incept.ch
Wed Jun 30 11:40:17 EDT 2004
Update of /cvs-repository/Products/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv26223/tests
Modified Files:
test_ActionInformation.py test_ActionProviderBase.py
Log Message:
- it's now possible to edit properties of an existing action directly. Example: action_provider.getActionObject('object/view').edit(title='Another Title') sets the title to a new value.
=== Products/CMFCore/tests/test_ActionInformation.py 1.8 => 1.9 ===
--- Products/CMFCore/tests/test_ActionInformation.py:1.8 Mon Apr 26 08:14:17 2004
+++ Products/CMFCore/tests/test_ActionInformation.py Wed Jun 30 11:40:17 2004
@@ -35,6 +35,20 @@
self.assertEqual(ai.getVisibility(), 1)
self.assertEqual(ai.getCategory(), 'object')
self.assertEqual(ai.getPermissions(), ())
+
+ def test_editing(self):
+ ai = ActionInformation(id='view',
+ category='folder',
+ )
+ ai.edit(id='new_id', title='blah')
+ self.assertEqual(ai.getId(), 'new_id')
+ self.assertEqual(ai.Title(), 'blah')
+ self.assertEqual(ai.Description(), '')
+ self.assertEqual(ai.getCondition(), '')
+ self.assertEqual(ai.getActionExpression(), '')
+ self.assertEqual(ai.getVisibility(), 1)
+ self.assertEqual(ai.getCategory(), 'folder')
+ self.assertEqual(ai.getPermissions(), ())
def test_construction_with_Expressions(self):
ai = ActionInformation(id='view'
=== Products/CMFCore/tests/test_ActionProviderBase.py 1.13 => 1.14 ===
--- Products/CMFCore/tests/test_ActionProviderBase.py:1.13 Mon Apr 26 08:14:17 2004
+++ Products/CMFCore/tests/test_ActionProviderBase.py Wed Jun 30 11:40:17 2004
@@ -167,6 +167,14 @@
rval = apb.listActionInfos('foo/another_id', check_visibility=0)
self.assertEqual( rval, [] )
+ def test_getActionObject(self):
+ apb = self.site._setObject( 'portal_apb', self._makeProvider(1) )
+ rval = apb.getActionObject('object/an_id')
+ self.assertEqual(rval, apb._actions[0])
+ rval = apb.getActionObject('object/not_existing_id')
+ self.assertEqual(rval, None)
+ self.assertRaises(ValueError, apb.getActionObject, 'wrong_format')
+
def test_getActionInfo(self):
wanted = {'permissions': '', 'id': 'an_id', 'url': '',
'name': 'A Title', 'visible': 0, 'category': 'object'}
More information about the CMF-checkins
mailing list