Author: russellm
Date: 2008-07-17 08:24:05 -0500 (Thu, 17 Jul 2008)
New Revision: 7940
Modified:
django/trunk/django/test/utils.py
Log:
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.
Modified: django/trunk/django/test/utils.py
===================================================================
--- django/trunk/django/test/utils.py 2008-07-16 23:55:10 UTC (rev 7939)
+++ django/trunk/django/test/utils.py 2008-07-17 13:24:05 UTC (rev 7940)
@@ -74,7 +74,10 @@
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)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---