Skip to content

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

Merged
merged 1 commit into from Nov 11, 2012

3 participants

@mgrouchy

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

references ticket: https://code.djangoproject.com/ticket/18482

@claudep claudep commented on the diff Jul 18, 2012
tests/regressiontests/cache/tests.py
@@ -266,6 +266,10 @@ def test_decr(self):
self.assertEqual(self.cache.get('answer'), 32)
self.assertRaises(ValueError, self.cache.decr, 'does_not_exist')
+ def test_close(self):
+ self.assertEqual(hasattr(self.cache, 'close'), True)
+ self.cache.close()
+
def test_data_types(self):
# Many different data types can be cached
stuff = {
@claudep
Django member
claudep added a note Jul 18, 2012

assertEqual(..., True) -> assertTrue(...)

@mgrouchy
mgrouchy added a note Jul 18, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@mgrouchy mgrouchy 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
a2e927b
@mgrouchy

updated as per feedback from @claudep.

@mgrouchy

Is there anything I can do to get this merged? Ticket says this is ready for checkin?

@mgrouchy

Anything I can do to help this along to get it merged in before the code freeze for 1.5. No big deal, just trying to get this closed out.

@aaugustin aaugustin merged commit 4c5cea7 into django:master Nov 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.