[Checkins] SVN: z3c.pt/trunk/src/z3c/pt/README.txt - Add failing tests for 'exists' with global, undefined name. Raises a NameError currently.

Sidnei da Silva sidnei at enfoldsystems.com
Mon Jan 19 18:27:24 EST 2009


Log message for revision 94868:
  - Add failing tests for 'exists' with global, undefined name. Raises a NameError currently.

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-01-19 23:13:25 UTC (rev 94867)
+++ z3c.pt/trunk/src/z3c/pt/README.txt	2009-01-19 23:27:23 UTC (rev 94868)
@@ -231,3 +231,40 @@
   <div xmlns="http://www.w3.org/1999/xhtml">
     <span>default content</span>
   </div>
+
+'exists'-type expression
+------------------------
+
+Using 'exists()' function on non-global name and global name:
+
+  >>> template = PageTemplate("""\
+  ... <div xmlns="http://www.w3.org/1999/xhtml">
+  ...   <span tal:content="python: exists('options/nope') and 'Yes' or 'No'"
+  ...         >do I exist?</span>
+  ...   <span tal:content="python: exists('nope') and 'Yes' or 'No'"
+  ...         >do I exist?</span>
+  ... </div>""")
+
+  >>> print template()
+  <div xmlns="http://www.w3.org/1999/xhtml">
+    <span>No</span>
+    <span>No</span>
+  </div>
+
+Using 'exists:' expression on non-global name and global name
+
+  >>> template = PageTemplate("""\
+  ... <div xmlns="http://www.w3.org/1999/xhtml">
+  ...   <span tal:define="yup exists:options/nope" 
+  ...         tal:content="python: yup and 'Yes' or 'No'"
+  ...         >do I exist?</span>
+  ...   <span tal:define="yup exists:nope" 
+  ...         tal:content="python: yup and 'Yes' or 'No'"
+  ...         >do I exist?</span>
+  ... </div>""")
+
+  >>> print template()
+  <div xmlns="http://www.w3.org/1999/xhtml">
+    <span>No</span>
+    <span>No</span>
+  </div>



More information about the Checkins mailing list