MCPcopy
hub / github.com/django/django / test_connect_non_autocommit

Method test_connect_non_autocommit

tests/backends/postgresql/tests.py:221–234  ·  view source on GitHub ↗

The connection wrapper shouldn't believe that autocommit is enabled after setting the time zone when AUTOCOMMIT is False (#21452).

(self)

Source from the content-addressed store, hash-verified

219 new_connection.close()
220
221 def test_connect_non_autocommit(self):
222 """
223 The connection wrapper shouldn't believe that autocommit is enabled
224 after setting the time zone when AUTOCOMMIT is False (#21452).
225 """
226 new_connection = no_pool_connection()
227 new_connection.settings_dict["AUTOCOMMIT"] = False
228
229 try:
230 # Open a database connection.
231 with new_connection.cursor():
232 self.assertFalse(new_connection.get_autocommit())
233 finally:
234 new_connection.close()
235
236 @unittest.skipUnless(is_psycopg3, "psycopg3 specific test")
237 def test_connect_pool(self):

Callers

nothing calls this directly

Calls 4

cursorMethod · 0.80
get_autocommitMethod · 0.80
no_pool_connectionFunction · 0.70
closeMethod · 0.45

Tested by

no test coverage detected