Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7940 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1107e6b47978cef0a511ed2ed247921d19d36803 1 parent 431206a
@freakboy3742 freakboy3742 authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 django/test/utils.py
View
5 django/test/utils.py
@@ -74,7 +74,10 @@ def teardown_test_environment():
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"):
connection.connection.set_isolation_level(0)
Please sign in to comment.
Something went wrong with that request. Please try again.