Refs #33060 -- Added memcached test for make_key() making keys invalid.

This commit is contained in:
Mariusz Felisiak 2021-09-03 11:13:39 +02:00
parent 3921b1c6d2
commit ec2f6ea9c6
1 changed files with 9 additions and 0 deletions

View File

@ -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(