Ticket #10831: 10831-test-case-nops-out-transaction-managed-func.diff

File 10831-test-case-nops-out-transaction-managed-func.diff, 1.1 KB (added by Sean Legassick, 16 years ago)
  • django/test/testcases.py

     
    3434real_leave_transaction_management = transaction.leave_transaction_management
    3535real_savepoint_commit = transaction.savepoint_commit
    3636real_savepoint_rollback = transaction.savepoint_rollback
     37real_managed = transaction.managed
    3738
    3839def nop(*args, **kwargs):
    3940    return
     
    4546    transaction.savepoint_rollback = nop
    4647    transaction.enter_transaction_management = nop
    4748    transaction.leave_transaction_management = nop
     49    transaction.managed = nop
    4850
    4951def restore_transaction_methods():
    5052    transaction.commit = real_commit
     
    5355    transaction.savepoint_rollback = real_savepoint_rollback
    5456    transaction.enter_transaction_management = real_enter_transaction_management
    5557    transaction.leave_transaction_management = real_leave_transaction_management
     58    transaction.managed = real_managed
    5659
    5760class OutputChecker(doctest.OutputChecker):
    5861    def check_output(self, want, got, optionflags):
Back to Top