mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Fixed #22279 -- Prevented dummy backend going through DatabaseErrorWrapper
Thanks Daniel Hahler for the report and Tim Graham for the review.
This commit is contained in:
		| @@ -60,6 +60,7 @@ class DatabaseWrapper(BaseDatabaseWrapper): | ||||
|     # do something raises complain; anything that tries | ||||
|     # to rollback or undo something raises ignore. | ||||
|     _cursor = complain | ||||
|     ensure_connection = complain | ||||
|     _commit = complain | ||||
|     _rollback = ignore | ||||
|     _close = ignore | ||||
|   | ||||
| @@ -41,6 +41,8 @@ class DummyBackendTest(TestCase): | ||||
|         conns = ConnectionHandler(DATABASES) | ||||
|         self.assertEqual(conns[DEFAULT_DB_ALIAS].settings_dict['ENGINE'], | ||||
|             'django.db.backends.dummy') | ||||
|         with self.assertRaises(ImproperlyConfigured): | ||||
|             conns[DEFAULT_DB_ALIAS].ensure_connection() | ||||
|  | ||||
|  | ||||
| @unittest.skipUnless(connection.vendor == 'oracle', "Test only for Oracle") | ||||
|   | ||||
		Reference in New Issue
	
	Block a user