From 7a7b331cd5975477597dac4dec7ee0ddb67f59e0 Mon Sep 17 00:00:00 2001 From: Bo Marchman Date: Wed, 15 Mar 2017 13:01:21 -0400 Subject: Fixed #27882 -- Allowed {% cache %} to cache indefinitely. --- tests/template_tests/syntax_tests/test_cache.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/template_tests/syntax_tests/test_cache.py b/tests/template_tests/syntax_tests/test_cache.py index 7dec02eb10..6a59cb3c75 100644 --- a/tests/template_tests/syntax_tests/test_cache.py +++ b/tests/template_tests/syntax_tests/test_cache.py @@ -122,6 +122,17 @@ class CacheTagTests(SimpleTestCase): output = self.engine.render_to_string('cache18') self.assertEqual(output, 'cache18') + @setup({ + 'first': '{% load cache %}{% cache None fragment19 %}content{% endcache %}', + 'second': '{% load cache %}{% cache None fragment19 %}not rendered{% endcache %}' + }) + def test_none_timeout(self): + """A timeout of None means "cache forever".""" + output = self.engine.render_to_string('first') + self.assertEqual(output, 'content') + output = self.engine.render_to_string('second') + self.assertEqual(output, 'content') + class CacheTests(SimpleTestCase): -- cgit v1.3