[Checkins] SVN: five.pt/trunk/src/five/pt/tests/test_persistenttemplate.py check that the path function in a python expression really works

Leonardo Rochael Almeida leorochael at gmail.com
Mon Feb 28 08:31:22 EST 2011


Log message for revision 120598:
  check that the path function in a python expression really works

Changed:
  U   five.pt/trunk/src/five/pt/tests/test_persistenttemplate.py

-=-
Modified: five.pt/trunk/src/five/pt/tests/test_persistenttemplate.py
===================================================================
--- five.pt/trunk/src/five/pt/tests/test_persistenttemplate.py	2011-02-28 13:00:16 UTC (rev 120597)
+++ five.pt/trunk/src/five/pt/tests/test_persistenttemplate.py	2011-02-28 13:31:21 UTC (rev 120598)
@@ -50,6 +50,10 @@
 </metal:use>
 """.strip()
 
+python_path_source = """
+<form tal:attributes="method python:path('context/method')" />
+""".strip()
+
 def generate_capture_source(names):
     params = ", ".join("%s=%s" % (name, name)
                        for name in names)
@@ -129,3 +133,9 @@
         template = self._makeOne('foo', repeat_object)
         # this should not raise an Unauthorized error
         self.assertEquals(template().strip().split(), u'0 1 2'.split())
+
+    def test_path_function(self):
+        # check that the "path" function inside a python expression works
+        self.folder.method = 'post'
+        template = self._makeOne('foo', python_path_source)
+        self.assertEquals(template(), u'<form method="post" />')



More information about the checkins mailing list