summaryrefslogtreecommitdiff
path: root/tests/cache
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cache')
-rw-r--r--tests/cache/tests.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/cache/tests.py b/tests/cache/tests.py
index f2b70a4919..1b40def85a 100644
--- a/tests/cache/tests.py
+++ b/tests/cache/tests.py
@@ -1417,6 +1417,15 @@ class BaseMemcachedTests(BaseCacheTests):
getattr(cache, operation)(*args)
self.assertEqual(str(cm.exception), msg)
+ def test_invalid_with_version_key_length(self):
+ # make_key() adds a version to the key and exceeds the limit.
+ key = 'a' * 248
+ expected_warning = (
+ 'Cache key will cause errors if used with memcached: '
+ '%r (longer than %s)' % (key, 250)
+ )
+ self._perform_invalid_key_test(key, expected_warning)
+
def test_default_never_expiring_timeout(self):
# Regression test for #22845
with self.settings(CACHES=caches_setting_for_tests(