aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-01-11 19:25:46 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2012-01-11 19:25:46 -0500
commit3266c0160d9103703400123b81a713db21ccd5be (patch)
tree91ca2ddb97ef2479ede46c11f579892b1cf66ebc /test
parent2bdec394ff76a9b84fc35e8b0e9a20f175f9b8a4 (diff)
downloadexternal_python_mako-3266c0160d9103703400123b81a713db21ccd5be.tar.gz
external_python_mako-3266c0160d9103703400123b81a713db21ccd5be.tar.bz2
external_python_mako-3266c0160d9103703400123b81a713db21ccd5be.zip
propagate cache_impl from lookup to template , #179
Diffstat (limited to 'test')
-rw-r--r--test/test_cache.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/test_cache.py b/test/test_cache.py
index aba204c..d898b02 100644
--- a/test/test_cache.py
+++ b/test/test_cache.py
@@ -392,7 +392,18 @@ class CacheTest(TemplateTest):
%>
""")
assert result_lines(t.render()) == ['foo: 1', 'foo: 1', 'foo: 3', 'foo: 3']
-
+
+ def test_lookup(self):
+ l = TemplateLookup(cache_impl='mock')
+ l.put_string("x", """
+ <%page cached="True" />
+ ${y}
+ """)
+ t = l.get_template("x")
+ assert result_lines(t.render(y=5)) == ["5"]
+ assert result_lines(t.render(y=7)) == ["5"]
+ assert isinstance(t.cache.impl, MockCacheImpl)
+
def test_invalidate(self):
t = Template("""
<%%def name="foo()" cached="True">