mirror of
https://github.com/django/django.git
synced 2024-12-25 10:35:48 +00:00
Fixed #10831 -- Prevented code running under a to-be-rolled-back test from calling commit via transaction.managed(False). Thanks seanl for report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10621 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
6c15b5db60
commit
d463580c1b
@ -34,6 +34,7 @@ real_enter_transaction_management = transaction.enter_transaction_management
|
|||||||
real_leave_transaction_management = transaction.leave_transaction_management
|
real_leave_transaction_management = transaction.leave_transaction_management
|
||||||
real_savepoint_commit = transaction.savepoint_commit
|
real_savepoint_commit = transaction.savepoint_commit
|
||||||
real_savepoint_rollback = transaction.savepoint_rollback
|
real_savepoint_rollback = transaction.savepoint_rollback
|
||||||
|
real_managed = transaction.managed
|
||||||
|
|
||||||
def nop(*args, **kwargs):
|
def nop(*args, **kwargs):
|
||||||
return
|
return
|
||||||
@ -45,6 +46,7 @@ def disable_transaction_methods():
|
|||||||
transaction.savepoint_rollback = nop
|
transaction.savepoint_rollback = nop
|
||||||
transaction.enter_transaction_management = nop
|
transaction.enter_transaction_management = nop
|
||||||
transaction.leave_transaction_management = nop
|
transaction.leave_transaction_management = nop
|
||||||
|
transaction.managed = nop
|
||||||
|
|
||||||
def restore_transaction_methods():
|
def restore_transaction_methods():
|
||||||
transaction.commit = real_commit
|
transaction.commit = real_commit
|
||||||
@ -53,6 +55,7 @@ def restore_transaction_methods():
|
|||||||
transaction.savepoint_rollback = real_savepoint_rollback
|
transaction.savepoint_rollback = real_savepoint_rollback
|
||||||
transaction.enter_transaction_management = real_enter_transaction_management
|
transaction.enter_transaction_management = real_enter_transaction_management
|
||||||
transaction.leave_transaction_management = real_leave_transaction_management
|
transaction.leave_transaction_management = real_leave_transaction_management
|
||||||
|
transaction.managed = real_managed
|
||||||
|
|
||||||
class OutputChecker(doctest.OutputChecker):
|
class OutputChecker(doctest.OutputChecker):
|
||||||
def check_output(self, want, got, optionflags):
|
def check_output(self, want, got, optionflags):
|
||||||
|
Loading…
Reference in New Issue
Block a user