mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Refs #32233 -- Added tests for nonexistent cache backend.
This commit is contained in:
		
							
								
								
									
										13
									
								
								tests/cache/tests.py
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										13
									
								
								tests/cache/tests.py
									
									
									
									
										vendored
									
									
								
							| @@ -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'] | ||||
|   | ||||
		Reference in New Issue
	
	Block a user