aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_inheritance.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-03-04 23:45:40 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2010-03-04 23:45:40 +0000
commita629df3f7ef4e36573671018a25e2e9aa0889dbf (patch)
treeeaefb6faad4bbaaf66ddfa27346b9cf2b29a414d /test/test_inheritance.py
parent4d91d760cd4ef62192c74ff0aa6c27c3d6dff844 (diff)
downloadexternal_python_mako-a629df3f7ef4e36573671018a25e2e9aa0889dbf.tar.gz
external_python_mako-a629df3f7ef4e36573671018a25e2e9aa0889dbf.tar.bz2
external_python_mako-a629df3f7ef4e36573671018a25e2e9aa0889dbf.zip
- merged -r481:499 of py3k branch.
- Python 3 support is added ! See README.py3k for installation and testing notes. [ticket:119]
Diffstat (limited to 'test/test_inheritance.py')
-rw-r--r--test/test_inheritance.py27
1 files changed, 18 insertions, 9 deletions
diff --git a/test/test_inheritance.py b/test/test_inheritance.py
index c9c6990..9f978d2 100644
--- a/test/test_inheritance.py
+++ b/test/test_inheritance.py
@@ -1,5 +1,5 @@
from mako.template import Template
-from mako import lookup
+from mako import lookup, util
import unittest
from util import flatten_result, result_lines
@@ -187,10 +187,10 @@ ${next.body()}
this is the base.
<%
- sorted = pageargs.items()
- sorted.sort()
+ sorted_ = pageargs.items()
+ sorted_ = sorted(sorted_)
%>
- pageargs: (type: ${type(pageargs)}) ${sorted}
+ pageargs: (type: ${type(pageargs)}) ${sorted_}
<%def name="foo()">
${next.body(**context.kwargs)}
</%def>
@@ -202,11 +202,20 @@ ${next.body()}
<%page args="x, y, z=7"/>
print ${x}, ${y}, ${z}
""")
- assert result_lines(collection.get_template('index').render(x=5,y=10)) == [
- "this is the base.",
- "pageargs: (type: <type 'dict'>) [('x', 5), ('y', 10)]",
- "print 5, 10, 7"
- ]
+
+ if util.py3k:
+ assert result_lines(collection.get_template('index').render_unicode(x=5,y=10)) == [
+ "this is the base.",
+ "pageargs: (type: <class 'dict'>) [('x', 5), ('y', 10)]",
+ "print 5, 10, 7"
+ ]
+ else:
+ assert result_lines(collection.get_template('index').render_unicode(x=5,y=10)) == [
+ "this is the base.",
+ "pageargs: (type: <type 'dict'>) [('x', 5), ('y', 10)]",
+ "print 5, 10, 7"
+ ]
+
def test_pageargs_2(self):
collection = lookup.TemplateLookup()
collection.put_string("base", """