1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

BaseCache now has a no-op close method as per ticket #18582

Also removed the hasattr check when firing request_finished signal for
caches with a 'close' method. Should be safe to call `cache.close`
everywhere now
This commit is contained in:
Mike Grouchy
2012-07-18 08:00:31 -04:00
parent 8184aff2b0
commit a2e927b7ed
5 changed files with 27 additions and 5 deletions

View File

@@ -266,6 +266,10 @@ class BaseCacheTests(object):
self.assertEqual(self.cache.get('answer'), 32)
self.assertRaises(ValueError, self.cache.decr, 'does_not_exist')
def test_close(self):
self.assertTrue(hasattr(self.cache, 'close'))
self.cache.close()
def test_data_types(self):
# Many different data types can be cached
stuff = {