Ticket #12979: django-testcase-support-savepoints.patch

File django-testcase-support-savepoints.patch, 1.3 KB (added by Forest Bond, 15 years ago)

Patch

  • django/test/testcases.py

    === modified file 'django/test/testcases.py'
     
    3737real_rollback = transaction.rollback
    3838real_enter_transaction_management = transaction.enter_transaction_management
    3939real_leave_transaction_management = transaction.leave_transaction_management
    40 real_savepoint_commit = transaction.savepoint_commit
    41 real_savepoint_rollback = transaction.savepoint_rollback
    4240real_managed = transaction.managed
    4341
    4442def nop(*args, **kwargs):
     
    4745def disable_transaction_methods():
    4846    transaction.commit = nop
    4947    transaction.rollback = nop
    50     transaction.savepoint_commit = nop
    51     transaction.savepoint_rollback = nop
    5248    transaction.enter_transaction_management = nop
    5349    transaction.leave_transaction_management = nop
    5450    transaction.managed = nop
     
    5652def restore_transaction_methods():
    5753    transaction.commit = real_commit
    5854    transaction.rollback = real_rollback
    59     transaction.savepoint_commit = real_savepoint_commit
    60     transaction.savepoint_rollback = real_savepoint_rollback
    6155    transaction.enter_transaction_management = real_enter_transaction_management
    6256    transaction.leave_transaction_management = real_leave_transaction_management
    6357    transaction.managed = real_managed
Back to Top