summaryrefslogtreecommitdiff
path: root/tests/cache
diff options
context:
space:
mode:
authorEd Morley <emorley@mozilla.com>2016-08-29 16:28:22 +0100
committerEd Morley <emorley@mozilla.com>2016-08-29 16:28:22 +0100
commit255456becdf1435ce685faea5f3b58d34993e8a8 (patch)
tree7f90dbe84894b898444ba322bd4a683b4b10734b /tests/cache
parent306545d80508a0d6d70c329667640e7b183c30f0 (diff)
[1.10.x] Fixed #19914 -- Fixed test failures with pylibmc.
Backport of 674e3fe13e5156344bfafbea59018b8837eb3044 from master
Diffstat (limited to 'tests/cache')
-rw-r--r--tests/cache/tests.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/cache/tests.py b/tests/cache/tests.py
index c44c07fd80..dffd54c984 100644
--- a/tests/cache/tests.py
+++ b/tests/cache/tests.py
@@ -1204,7 +1204,15 @@ class BaseMemcachedTests(BaseCacheTests):
self.assertEqual(cache.get('small_value'), 'a')
large_value = 'a' * (max_value_length + 1)
- cache.set('small_value', large_value)
+ try:
+ cache.set('small_value', large_value)
+ except Exception:
+ # Some clients (e.g. pylibmc) raise when the value is too large,
+ # while others (e.g. python-memcached) intentionally return True
+ # indicating success. This test is primarily checking that the key
+ # was deleted, so the return/exception behavior for the set()
+ # itself is not important.
+ pass
# small_value should be deleted, or set if configured to accept larger values
value = cache.get('small_value')
self.assertTrue(value is None or value == large_value)
@@ -1232,6 +1240,15 @@ class MemcachedCacheTests(BaseMemcachedTests, TestCase):
class PyLibMCCacheTests(BaseMemcachedTests, TestCase):
base_params = PyLibMCCache_params
+ # By default, pylibmc/libmemcached don't verify keys client-side and so
+ # this test triggers a server-side bug that causes later tests to fail
+ # (#19914). The `verify_keys` behavior option could be set to True (which
+ # would avoid triggering the server-side bug), however this test would
+ # still fail due to https://github.com/lericson/pylibmc/issues/219.
+ @unittest.skip("triggers a memcached-server bug, causing subsequent tests to fail")
+ def test_invalid_key_characters(self):
+ pass
+
@override_settings(CACHES=caches_setting_for_tests(
BACKEND='django.core.cache.backends.filebased.FileBasedCache',