summaryrefslogtreecommitdiff
path: root/tests/template_tests
diff options
context:
space:
mode:
authorBaptiste Mispelon <bm@m2bpo.com>2013-03-25 09:10:32 +0100
committerFlorian Apolloner <florian@apolloner.eu>2013-03-30 12:13:08 +0100
commit5080311998a8ecc5b3f9fa162c19e55b70aa9f85 (patch)
treef0d9479097e1595bab58a752b302200de4e1795a /tests/template_tests
parent465b01f065a8482bfa42c19e3854a3c810e69d33 (diff)
Fixed #20130 -- Regression in {% cache %} template tag.
Diffstat (limited to 'tests/template_tests')
-rw-r--r--tests/template_tests/tests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/template_tests/tests.py b/tests/template_tests/tests.py
index 46d1f921e2..a9db9edc2f 100644
--- a/tests/template_tests/tests.py
+++ b/tests/template_tests/tests.py
@@ -441,6 +441,11 @@ class Templates(TestCase):
output1 = template.render(Context({'foo': range(3), 'get_value': lambda: next(gen1)}))
self.assertEqual(output1, '[0,1,2,3]', 'Expected [0,1,2,3] in first template, got {0}'.format(output1))
+ def test_cache_regression_20130(self):
+ t = Template('{% load cache %}{% cache 1 regression_20130 %}foo{% endcache %}')
+ cachenode = t.nodelist[1]
+ self.assertEqual(cachenode.fragment_name, 'regression_20130')
+
def test_ifchanged_render_once(self):
""" Test for ticket #19890. The content of ifchanged template tag was
rendered twice."""