MCPcopy
hub / github.com/django/django / test_service_name

Method test_service_name

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

Source from the content-addressed store, hash-verified

162 DatabaseWrapper(settings).get_connection_params()
163
164 def test_service_name(self):
165 from django.db.backends.postgresql.base import DatabaseWrapper
166
167 settings = connection.settings_dict.copy()
168 settings["OPTIONS"] = {"service": "my_service"}
169 settings["NAME"] = ""
170 params = DatabaseWrapper(settings).get_connection_params()
171 self.assertEqual(params["service"], "my_service")
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.

Callers

nothing calls this directly

Calls 3

DatabaseWrapperClass · 0.90
copyMethod · 0.45
get_connection_paramsMethod · 0.45

Tested by

no test coverage detected