diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-09-03 11:13:39 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-09-07 11:57:14 +0200 |
| commit | ec2f6ea9c6203524933e08d069733cd00a09ede3 (patch) | |
| tree | a07ef16b718ffa961dfb31661f533515526652a9 /tests/cache | |
| parent | 3921b1c6d24c9d5a60e5f5f83c9a394104089c21 (diff) | |
| download | django-ec2f6ea9c6203524933e08d069733cd00a09ede3.tar.gz | |
Refs #33060 -- Added memcached test for make_key() making keys invalid.
Diffstat (limited to 'tests/cache')
| -rw-r--r-- | tests/cache/tests.py | 9 |
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( |
