1. Luke Plant
  2. django


russ...@bcc190cf-cafb-0310-a4f2-bffc1f526a37  committed 975c53a

Fixed #7751 -- Added check to allow for the fact that autocommit can be a property, rather than a function on certain database backends. Thanks to Leo Soto for the fix.

  • Participants
  • Parent commits 0867444
  • Branches default

Comments (0)

Files changed (1)

File django/test/utils.py

View file
 def _set_autocommit(connection):
     "Make sure a connection is in autocommit mode."
     if hasattr(connection.connection, "autocommit"):
-        connection.connection.autocommit(True)
+        if callable(connection.connection.autocommit):
+            connection.connection.autocommit(True)
+        else:
+            connection.connection.autocommit = True
     elif hasattr(connection.connection, "set_isolation_level"):