Ticket #4041: 4041.2.diff
File 4041.2.diff, 1.0 KB (added by , 18 years ago) |
---|
-
django/core/cache/backends/base.py
54 54 Returns True if the key is in the cache and has not expired. 55 55 """ 56 56 return self.get(key) is not None 57 58 # Allow use of 'in' operator. 59 __contains__ = has_key -
tests/regressiontests/cache/tests.py
46 46 self.assertEqual(cache.has_key("hello"), True) 47 47 self.assertEqual(cache.has_key("goodbye"), False) 48 48 49 def test_in(self): 50 cache.set("hello", "goodbye") 51 self.assertEqual("hello" in cache, True) 52 self.assertEqual("goodbye" in cache, False) 53 49 54 def test_data_types(self): 50 55 # test data types 51 56 stuff = {