MCPcopy
hub / github.com/django/django / test_service_name_default_db

Method test_service_name_default_db

tests/backends/postgresql/tests.py:174–183  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

172 self.assertNotIn("database", params)
173
174 def test_service_name_default_db(self):
175 # None is used to connect to the default 'postgres' db.
176 from django.db.backends.postgresql.base import DatabaseWrapper
177
178 settings = connection.settings_dict.copy()
179 settings["NAME"] = None
180 settings["OPTIONS"] = {"service": "django_test"}
181 params = DatabaseWrapper(settings).get_connection_params()
182 self.assertEqual(params["dbname"], "postgres")
183 self.assertNotIn("service", params)
184
185 def test_connect_and_rollback(self):
186 """

Callers

nothing calls this directly

Calls 3

DatabaseWrapperClass · 0.90
copyMethod · 0.45
get_connection_paramsMethod · 0.45

Tested by

no test coverage detected