summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2012-02-09 18:58:25 +0000
committerJannis Leidel <jannis@leidel.info>2012-02-09 18:58:25 +0000
commitc609b792f74948bc4e485ebfcb456ef1b6f8ce0a (patch)
tree5b04b598ae0a513a0abd8063c6ac65230cfce155 /tests
parent75c60e80536552125f014fde15e2964ec128c65c (diff)
Fixed #17286 -- Made sure all cache backends are set up to connect to the signal handler that closes the cache connection when the request has been processed. Thanks, gnosek.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17479 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/cache/tests.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/regressiontests/cache/tests.py b/tests/regressiontests/cache/tests.py
index 0e28f66ae8..bd29cde533 100644
--- a/tests/regressiontests/cache/tests.py
+++ b/tests/regressiontests/cache/tests.py
@@ -1040,6 +1040,13 @@ class GetCacheTests(unittest.TestCase):
self.assertRaises(InvalidCacheBackendError, get_cache, 'does_not_exist')
+ def test_close(self):
+ from django.core import signals
+ cache = get_cache('regressiontests.cache.closeable_cache.CacheClass')
+ self.assertFalse(cache.closed)
+ signals.request_finished.send(self.__class__)
+ self.assertTrue(cache.closed)
+
class CacheUtils(TestCase):
"""TestCase for django.utils.cache functions."""