[Zope3-checkins] SVN: Zope3/trunk/ For ``for`` parameter of the
<browser:menuItem> and
Philipp von Weitershausen
philikon at philikon.de
Thu Apr 7 10:26:38 EDT 2005
Log message for revision 29897:
For ``for`` parameter of the <browser:menuItem> and
<browser:menuItems> directives was not marked as required in
the directive schema, while it actually was expected to be
required.
Changed:
U Zope3/trunk/doc/CHANGES.txt
U Zope3/trunk/src/zope/app/publisher/browser/metadirectives.py
U Zope3/trunk/src/zope/app/publisher/browser/tests/test_directives.py
-=-
Modified: Zope3/trunk/doc/CHANGES.txt
===================================================================
--- Zope3/trunk/doc/CHANGES.txt 2005-04-07 04:48:06 UTC (rev 29896)
+++ Zope3/trunk/doc/CHANGES.txt 2005-04-07 14:26:38 UTC (rev 29897)
@@ -692,6 +692,11 @@
(``IUserPreferredLanguages``), instead of hard-wiring the
default one.
+ - For ``for`` parameter of the <browser:menuItem> and
+ <browser:menuItems> directives was not marked as required in
+ the directive schema, while it actually was expected to be
+ required.
+
Much thanks to everyone who contributed to this release:
Jim Fulton, Fred Drake, Philipp von Weitershausen, Stephan Richter,
Modified: Zope3/trunk/src/zope/app/publisher/browser/metadirectives.py
===================================================================
--- Zope3/trunk/src/zope/app/publisher/browser/metadirectives.py 2005-04-07 04:48:06 UTC (rev 29896)
+++ Zope3/trunk/src/zope/app/publisher/browser/metadirectives.py 2005-04-07 14:26:38 UTC (rev 29897)
@@ -415,7 +415,7 @@
for_ = GlobalInterface(
title=u"Interface",
description=u"The interface the menu items are defined for",
- required=False
+ required=True
)
layer = LayerField(
Modified: Zope3/trunk/src/zope/app/publisher/browser/tests/test_directives.py
===================================================================
--- Zope3/trunk/src/zope/app/publisher/browser/tests/test_directives.py 2005-04-07 04:48:06 UTC (rev 29896)
+++ Zope3/trunk/src/zope/app/publisher/browser/tests/test_directives.py 2005-04-07 14:26:38 UTC (rev 29897)
@@ -1157,6 +1157,33 @@
self.assert_(isinstance(v, V1))
+ def testMenuItemNeedsFor(self):
+ # <browser:menuItem> directive fails if no 'for' argument was provided
+ from zope.configuration.exceptions import ConfigurationError
+ self.assertRaises(ConfigurationError, xmlconfig, StringIO(template %
+ '''
+ <browser:menu
+ id="test_menu" title="Test menu" />
+ <browser:menuItem
+ title="Test Entry"
+ menu="test_menu"
+ action="@@test"
+ />
+ '''
+ ))
+
+ # it works, when the argument is there and a valid interface
+ xmlconfig(StringIO(template %
+ '''
+ <browser:menuItem
+ for="zope.app.component.tests.views.IC"
+ title="Test Entry"
+ menu="test_menu"
+ action="@@test"
+ />
+ '''
+ ))
+
def test_suite():
return unittest.TestSuite((
unittest.makeSuite(Test),
More information about the Zope3-Checkins
mailing list