1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Moved ensure_defaults() and prepare_test_settings() logic to ConnectionHandler.configure_settings().

This commit is contained in:
Florian Apolloner
2022-03-17 07:31:47 +01:00
committed by Mariusz Felisiak
parent 58ad9a99a7
commit 13378ad952
2 changed files with 25 additions and 64 deletions

View File

@@ -50,26 +50,6 @@ class ConnectionHandlerTests(SimpleTestCase):
with self.assertRaisesMessage(ConnectionDoesNotExist, msg):
conns["nonexistent"]
def test_ensure_defaults_nonexistent_alias(self):
msg = "The connection 'nonexistent' doesn't exist."
conns = ConnectionHandler(
{
DEFAULT_DB_ALIAS: {"ENGINE": "django.db.backends.dummy"},
}
)
with self.assertRaisesMessage(ConnectionDoesNotExist, msg):
conns.ensure_defaults("nonexistent")
def test_prepare_test_settings_nonexistent_alias(self):
msg = "The connection 'nonexistent' doesn't exist."
conns = ConnectionHandler(
{
DEFAULT_DB_ALIAS: {"ENGINE": "django.db.backends.dummy"},
}
)
with self.assertRaisesMessage(ConnectionDoesNotExist, msg):
conns.prepare_test_settings("nonexistent")
class DatabaseErrorWrapperTests(TestCase):
@unittest.skipUnless(connection.vendor == "postgresql", "PostgreSQL test")