summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Apolloner <florian@apolloner.eu>2022-03-17 07:19:18 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-03-17 07:36:34 +0100
commit58ad9a99a744b036fa69c4d03eca5618ea949f93 (patch)
tree5ffb23ecf831edaa1b4ee42896bd90e0370ba5ff
parente458abc5931861e72f18b5d218726f9add7028cd (diff)
Removed usage of django.db.utils.ConnectionHandler.databases.
-rw-r--r--django/db/utils.py6
-rw-r--r--tests/gis_tests/inspectapp/tests.py2
2 files changed, 4 insertions, 4 deletions
diff --git a/django/db/utils.py b/django/db/utils.py
index 7ef62ae5a2..5459fc9a33 100644
--- a/django/db/utils.py
+++ b/django/db/utils.py
@@ -166,7 +166,7 @@ class ConnectionHandler(BaseConnectionHandler):
where no settings is provided.
"""
try:
- conn = self.databases[alias]
+ conn = self.settings[alias]
except KeyError:
raise self.exception_class(f"The connection '{alias}' doesn't exist.")
@@ -187,7 +187,7 @@ class ConnectionHandler(BaseConnectionHandler):
Make sure the test settings are available in the 'TEST' sub-dictionary.
"""
try:
- conn = self.databases[alias]
+ conn = self.settings[alias]
except KeyError:
raise self.exception_class(f"The connection '{alias}' doesn't exist.")
@@ -205,7 +205,7 @@ class ConnectionHandler(BaseConnectionHandler):
def create_connection(self, alias):
self.ensure_defaults(alias)
self.prepare_test_settings(alias)
- db = self.databases[alias]
+ db = self.settings[alias]
backend = load_backend(db["ENGINE"])
return backend.DatabaseWrapper(db, alias)
diff --git a/tests/gis_tests/inspectapp/tests.py b/tests/gis_tests/inspectapp/tests.py
index 6ff3a33fc4..0145483f6b 100644
--- a/tests/gis_tests/inspectapp/tests.py
+++ b/tests/gis_tests/inspectapp/tests.py
@@ -204,7 +204,7 @@ def get_ogr_db_string():
GDAL will create its own connection to the database, so we re-use the
connection settings from the Django test.
"""
- db = connections.databases["default"]
+ db = connections.settings["default"]
# Map from the django backend into the OGR driver name and database identifier
# https://gdal.org/drivers/vector/