Django

Code

Changeset 7940

Show
Ignore:
Timestamp:
07/17/08 08:24:05 (4 months ago)
Author:
russellm
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/test/utils.py

    r6930 r7940  
    7575    "Make sure a connection is in autocommit mode." 
    7676    if hasattr(connection.connection, "autocommit"): 
    77         connection.connection.autocommit(True) 
     77        if callable(connection.connection.autocommit): 
     78            connection.connection.autocommit(True) 
     79        else: 
     80            connection.connection.autocommit = True 
    7881    elif hasattr(connection.connection, "set_isolation_level"): 
    7982        connection.connection.set_isolation_level(0)