Fixed #27882 -- Allowed {% cache %} to cache indefinitely.

This commit is contained in:
Bo Marchman 2017-03-15 13:01:21 -04:00 committed by Tim Graham
parent 44f9241c48
commit 7a7b331cd5
3 changed files with 23 additions and 6 deletions

View file

@ -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):