[Zope-Checkins] SVN: Zope/trunk/src/Products/Five/browser/ merge r110118-110121 from 2.12 branch
David Glick
davidglick at onenw.org
Tue Mar 23 18:01:17 EDT 2010
Log message for revision 110122:
merge r110118-110121 from 2.12 branch
Changed:
U Zope/trunk/src/Products/Five/browser/metaconfigure.py
U Zope/trunk/src/Products/Five/browser/tests/test_metaconfigure.py
-=-
Modified: Zope/trunk/src/Products/Five/browser/metaconfigure.py
===================================================================
--- Zope/trunk/src/Products/Five/browser/metaconfigure.py 2010-03-23 21:52:11 UTC (rev 110121)
+++ Zope/trunk/src/Products/Five/browser/metaconfigure.py 2010-03-23 22:01:16 UTC (rev 110122)
@@ -231,7 +231,7 @@
if view is not None:
return view
- raise NotFoundError(self, name, request)
+ raise NotFound(self, name, request)
cdict['publishTraverse'] = publishTraverse
@@ -422,6 +422,8 @@
raise NotFound(self, name, request)
def __getitem__(self, name):
+ if name == 'macros':
+ return self.index.macros
return self.index.macros[name]
def __call__(self, *args, **kw):
Modified: Zope/trunk/src/Products/Five/browser/tests/test_metaconfigure.py
===================================================================
--- Zope/trunk/src/Products/Five/browser/tests/test_metaconfigure.py 2010-03-23 21:52:11 UTC (rev 110121)
+++ Zope/trunk/src/Products/Five/browser/tests/test_metaconfigure.py 2010-03-23 22:01:16 UTC (rev 110122)
@@ -41,6 +41,12 @@
index.macros = {}
index.macros['aaa'] = aaa = object()
self.failUnless(view['aaa'] is aaa)
+
+ def test__getitem__gives_shortcut_to_index_macros(self):
+ view = self._makeOne()
+ view.index = index = DummyTemplate()
+ index.macros = {}
+ self.failUnless(view['macros'] is index.macros)
def test___call___no_args_no_kw(self):
view = self._makeOne()
@@ -63,7 +69,7 @@
self.failUnless(result is index)
self.assertEqual(index._called_with, ((), {'foo': 'bar'}))
- def test___call___no_args_no_kw(self):
+ def test___call___w_args_w_kw(self):
view = self._makeOne()
view.index = index = DummyTemplate()
result = view('abc', foo='bar')
More information about the Zope-Checkins
mailing list