[Checkins] SVN: z3c.pt/trunk/src/z3c/pt/README.txt - Add failing test for a variable leak across tags with macro usage

Sidnei da Silva sidnei.da.silva at gmail.com
Thu May 21 20:13:45 EDT 2009


Log message for revision 100222:
  - Add failing test for a variable leak across tags with macro usage

Changed:
  U   z3c.pt/trunk/src/z3c/pt/README.txt

-=-
Modified: z3c.pt/trunk/src/z3c/pt/README.txt
===================================================================
--- z3c.pt/trunk/src/z3c/pt/README.txt	2009-05-21 21:41:29 UTC (rev 100221)
+++ z3c.pt/trunk/src/z3c/pt/README.txt	2009-05-22 00:13:45 UTC (rev 100222)
@@ -366,6 +366,46 @@
     <span>XXX</span>
   </div>
 
+
+Variable from one tag never leak into another
+---------------------------------------------
+
+  >>> body = """\
+  ... <div xmlns="http://www.w3.org/1999/xhtml"
+  ...      xmlns:tal="http://xml.zope.org/namespaces/tal"
+  ...      xmlns:metal="http://xml.zope.org/namespaces/metal">
+  ...   <div class="macro" metal:define-macro="greeting"
+  ...        tal:define="greeting greeting|string:'Hey'">
+  ...       <span tal:replace="greeting" />
+  ...   </div>
+  ...   <div tal:define="greeting string:'Hello'">
+  ...	  <metal:block metal:use-macro="python:template.macros['greeting']" />
+  ...   </div>
+  ...   <div>
+  ...	  <metal:block metal:use-macro="python:template.macros['greeting']" />
+  ...   </div>
+  ... </div>"""
+  >>> print PageTemplate(body)()
+  <div xmlns="http://www.w3.org/1999/xhtml">
+    <div class="macro">
+        'Hey'
+    </div>
+    <div>
+      <div class="macro">
+        'Hello'
+    </div>
+  <BLANKLINE>
+  </div>
+    <div>
+      <div class="macro">
+        'Hey'
+    </div>
+  <BLANKLINE>
+  </div>
+  </div>
+
+
+
 TALES Function Namespaces
 -------------------------
 



More information about the Checkins mailing list