summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBas Peschier <basp@fabrique.nl>2013-02-24 13:36:04 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-02-24 13:56:15 +0100
commit5a9b2bce242bd2f8a9fed6ac735406ce68b10738 (patch)
tree2fde6669666d644ff1732d70ac7d5a61ace7d89d /tests
parentd7e835f76d81d66a6d8964dba20506a1c6e559d8 (diff)
Fixed #19810 -- MemcachedCache now uses pickle.HIGHEST_PROTOCOL
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/cache/tests.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/regressiontests/cache/tests.py b/tests/regressiontests/cache/tests.py
index b446465d32..17d17f7fdd 100644
--- a/tests/regressiontests/cache/tests.py
+++ b/tests/regressiontests/cache/tests.py
@@ -12,6 +12,7 @@ import string
import tempfile
import time
import warnings
+import pickle
from django.conf import settings
from django.core import management
@@ -984,6 +985,18 @@ class MemcachedCacheTests(unittest.TestCase, BaseCacheTests):
# memcached limits key length to 250
self.assertRaises(Exception, self.cache.set, 'a' * 251, 'value')
+ # Explicitly display a skipped test if no configured cache uses MemcachedCache
+ @unittest.skipUnless(
+ any(cache['BACKEND'] == 'django.core.cache.backends.memcached.MemcachedCache'
+ for cache in settings.CACHES.values()),
+ "cache with python-memcached library not available")
+ def test_memcached_uses_highest_pickle_version(self):
+ # Regression test for #19810
+ for cache_key, cache in settings.CACHES.items():
+ if cache['BACKEND'] == 'django.core.cache.backends.memcached.MemcachedCache':
+ self.assertEqual(get_cache(cache_key)._cache.pickleProtocol,
+ pickle.HIGHEST_PROTOCOL)
+
class FileBasedCacheTests(unittest.TestCase, BaseCacheTests):
"""