summaryrefslogtreecommitdiff
path: root/django/test/utils.py
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2008-07-17 13:24:05 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2008-07-17 13:24:05 +0000
commit1107e6b47978cef0a511ed2ed247921d19d36803 (patch)
tree68c36121202305262a609f6decd03ba4ae350671 /django/test/utils.py
parent431206a2523c2d4ceddd710b3075567eea9b2176 (diff)
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
Diffstat (limited to 'django/test/utils.py')
-rw-r--r--django/test/utils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/test/utils.py b/django/test/utils.py
index b1c528873c..41de932964 100644
--- a/django/test/utils.py
+++ b/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)