diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-02-20 19:33:55 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-02-20 19:33:55 -0500 |
commit | 6c06a3270b6fca6d959fff4c81cf932e17a475d2 (patch) | |
tree | 8aa687367177c91438b31a51c3ca43528c5841ad /test/test_template.py | |
parent | 4737c269f5658fdab4190504cd5744e95bae1688 (diff) | |
download | external_python_mako-6c06a3270b6fca6d959fff4c81cf932e17a475d2.tar.gz external_python_mako-6c06a3270b6fca6d959fff4c81cf932e17a475d2.tar.bz2 external_python_mako-6c06a3270b6fca6d959fff4c81cf932e17a475d2.zip |
- the keys() in the Context, as well as
it's internal _data dictionary, now
include just what was specified to
render() as well as Mako builtins
'caller', 'capture'. The contents
of __builtin__ are no longer copied.
Diffstat (limited to 'test/test_template.py')
-rw-r--r-- | test/test_template.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/test/test_template.py b/test/test_template.py index ba47885..2ac4ad3 100644 --- a/test/test_template.py +++ b/test/test_template.py @@ -3,11 +3,13 @@ from mako.template import Template, ModuleTemplate from mako.lookup import TemplateLookup from mako.ext.preprocessors import convert_comments -from mako import exceptions, util -import re, os +from mako import exceptions, util, runtime +import re +import os from util import flatten_result, result_lines import codecs -from test import TemplateTest, eq_, template_base, module_base, skip_if, assert_raises +from test import TemplateTest, eq_, template_base, module_base, \ + skip_if, assert_raises class EncodingTest(TemplateTest): def test_unicode(self): @@ -442,7 +444,11 @@ class PageArgsTest(TemplateTest): template_args={'variable':'var', 'bar':'bar', 'foo':'foo'} ) - + + def test_context_small(self): + ctx = runtime.Context([].append, x=5, y=4) + eq_(sorted(ctx.keys()), ['caller', 'capture', 'x', 'y']) + def test_with_context(self): template = Template(""" <%page args="x, y, z=7"/> |