diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2008-07-17 13:24:05 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2008-07-17 13:24:05 +0000 |
| commit | 1107e6b47978cef0a511ed2ed247921d19d36803 (patch) | |
| tree | 68c36121202305262a609f6decd03ba4ae350671 /django/test/utils.py | |
| parent | 431206a2523c2d4ceddd710b3075567eea9b2176 (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.py | 5 |
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) |
