diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-12-08 07:28:59 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-12-08 08:54:54 +0100 |
| commit | 0f00560d45ab2931647b0cbe44a27c37c576c6dc (patch) | |
| tree | 53416a91ba01b6b92c4bb77ebf6c67e0483e2dc3 /tests/cache | |
| parent | 30f2d1af03b1f1e981e8e15151079795914f8f2c (diff) | |
Refs #32233 -- Added tests for nonexistent cache backend.
Diffstat (limited to 'tests/cache')
| -rw-r--r-- | tests/cache/tests.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/cache/tests.py b/tests/cache/tests.py index dd4d441ad1..7172b5e9d9 100644 --- a/tests/cache/tests.py +++ b/tests/cache/tests.py @@ -2504,3 +2504,16 @@ class CacheHandlerTest(SimpleTestCase): msg = "Could not find config for 'nonexistent' in settings.CACHES" with self.assertRaisesMessage(InvalidCacheBackendError, msg): caches['nonexistent'] + + def test_nonexistent_backend(self): + msg = ( + "Could not find backend 'django.nonexistent.NonexistentBackend': " + "No module named 'django.nonexistent'" + ) + with self.settings(CACHES={ + 'invalid_backend': { + 'BACKEND': 'django.nonexistent.NonexistentBackend', + }, + }): + with self.assertRaisesMessage(InvalidCacheBackendError, msg): + caches['invalid_backend'] |
