From 6a2165816394ab4bb259f6171e82417e098e97a6 Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Tue, 6 Dec 2022 11:37:25 +0100 Subject: Refs #33308 -- Modernized database wrapper in the PostgreSQL backend. - Used connection.info instead of connection.get_parameter_status() and connection.server_info which don't exist in psycopg 3. - Set encoding using the client_encoding connection parameter instead of connection.set_client_encoding() that doesn't exist in psycopg 3. - Used the dbname connection parameter instead of deprecated alias - database. --- tests/backends/postgresql/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/backends/postgresql') diff --git a/tests/backends/postgresql/tests.py b/tests/backends/postgresql/tests.py index e28acef2c0..f056162454 100644 --- a/tests/backends/postgresql/tests.py +++ b/tests/backends/postgresql/tests.py @@ -164,7 +164,7 @@ class Tests(TestCase): settings["NAME"] = None settings["OPTIONS"] = {"service": "django_test"} params = DatabaseWrapper(settings).get_connection_params() - self.assertEqual(params["database"], "postgres") + self.assertEqual(params["dbname"], "postgres") self.assertNotIn("service", params) def test_connect_and_rollback(self): -- cgit v1.2.1