Log message for revision 68228: IMHO, the fact that test used to pass with the Zope 2 ZPT implementation demonstrates a bug in the very same: The local variable bag was kept when a new scope was opened, hence it could be polluted by lower scopes. Zope 3 makes a copy of the local variable bag when it starts a new scope. This is there Right Thing(tm) to do. This test is now identical to its Zope 3 equivalent.
Changed: U Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/tests/testTALES.py -=- Modified: Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/tests/testTALES.py =================================================================== --- Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/tests/testTALES.py 2006-05-22 00:37:11 UTC (rev 68227) +++ Zope/branches/ajung-zpt-end-game/lib/python/Products/PageTemplates/tests/testTALES.py 2006-05-22 00:47:42 UTC (rev 68228) @@ -104,23 +104,25 @@ def testVariables(self): '''Test variables''' ctxt = self.getContext() - c = ctxt.vars ctxt.beginScope() ctxt.setLocal('v1', 1) ctxt.setLocal('v2', 2) + c = ctxt.vars assert c['v1'] == 1, 'Variable "v1"' ctxt.beginScope() ctxt.setLocal('v1', 3) ctxt.setGlobal('g', 1) + c = ctxt.vars assert c['v1'] == 3, 'Inner scope' assert c['v2'] == 2, 'Outer scope' assert c['g'] == 1, 'Global' ctxt.endScope() + c = ctxt.vars assert c['v1'] == 1, "Uncovered local" assert c['g'] == 1, "Global from inner scope" _______________________________________________ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins