Ticket #7751: autocommit.diff

File autocommit.diff, 672 bytes (added by Leo Soto M., 16 years ago)
  • django/test/utils.py

    diff -r 1142c4cdf9ae django/test/utils.py
    a b  
    7474def _set_autocommit(connection):
    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)
    8083
Back to Top