summaryrefslogtreecommitdiff
path: root/tests/regressiontests/cache
diff options
context:
space:
mode:
authorGary Wilson Jr <gary.wilson@gmail.com>2007-07-15 06:24:54 +0000
committerGary Wilson Jr <gary.wilson@gmail.com>2007-07-15 06:24:54 +0000
commitae7f04caab1b4f2a2b509b036499e4e042caaac6 (patch)
treeb32456f6ef266c330ebc4c78fba8474d4b07dd7d /tests/regressiontests/cache
parent208352e5d753ebc11c407a22dd0629f8f9b61592 (diff)
Fixed #3012 -- Changed the locmem cache backend to use pickle instead of deepcopy to make it compatible with iterators (which cannot be copied). Patch from Sundance.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5703 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/cache')
-rw-r--r--tests/regressiontests/cache/tests.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/regressiontests/cache/tests.py b/tests/regressiontests/cache/tests.py
index 9dc7161c03..0a5185e86e 100644
--- a/tests/regressiontests/cache/tests.py
+++ b/tests/regressiontests/cache/tests.py
@@ -4,7 +4,7 @@
from django.core.cache import cache
import time, unittest
-# functions/classes for complex data type tests
+# functions/classes for complex data type tests
def f():
return 42
class C:
@@ -46,13 +46,12 @@ class Cache(unittest.TestCase):
self.assertEqual(cache.has_key("hello"), True)
self.assertEqual(cache.has_key("goodbye"), False)
- def test_in(self):
- cache.set("hello", "goodbye")
- self.assertEqual("hello" in cache, True)
- self.assertEqual("goodbye" in cache, False)
+ def test_in(self):
+ cache.set("hello", "goodbye")
+ self.assertEqual("hello" in cache, True)
+ self.assertEqual("goodbye" in cache, False)
def test_data_types(self):
- # test data types
stuff = {
'string' : 'this is a string',
'int' : 42,
@@ -61,11 +60,12 @@ class Cache(unittest.TestCase):
'dict' : {'A': 1, 'B' : 2},
'function' : f,
'class' : C,
+ 'iter' : iter([1, 2 ,3]),
}
for (key, value) in stuff.items():
cache.set(key, value)
self.assertEqual(cache.get(key), value)
-
+
def test_expiration(self):
# expiration
cache.set('expire', 'very quickly', 1)