diff options
| author | Bo Marchman <bo.marchman@gmail.com> | 2017-03-15 13:01:21 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-03-15 13:01:21 -0400 |
| commit | 7a7b331cd5975477597dac4dec7ee0ddb67f59e0 (patch) | |
| tree | aadc03f82abb0559cf3c2c7d1ac5b5fa0efd238c /tests/template_tests/syntax_tests/test_cache.py | |
| parent | 44f9241c48e28823b140bc4ec7515f5a88b88c32 (diff) | |
Fixed #27882 -- Allowed {% cache %} to cache indefinitely.
Diffstat (limited to 'tests/template_tests/syntax_tests/test_cache.py')
| -rw-r--r-- | tests/template_tests/syntax_tests/test_cache.py | 11 |
1 files changed, 11 insertions, 0 deletions
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): |
