summaryrefslogtreecommitdiff
path: root/django/test/testcases.py
diff options
context:
space:
mode:
authorKaren Tracey <kmtracey@gmail.com>2009-04-22 19:10:28 +0000
committerKaren Tracey <kmtracey@gmail.com>2009-04-22 19:10:28 +0000
commitd463580c1bbc17c6180d2f9638768769e850d8d0 (patch)
tree3be3e4d2d3dece69917dc5f2987341cfd0062c13 /django/test/testcases.py
parent6c15b5db6014a7dadb0c237e689bdaed4761fb16 (diff)
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
Diffstat (limited to 'django/test/testcases.py')
-rw-r--r--django/test/testcases.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/django/test/testcases.py b/django/test/testcases.py
index 794bc5039d..8c73c63796 100644
--- a/django/test/testcases.py
+++ b/django/test/testcases.py
@@ -34,6 +34,7 @@ real_enter_transaction_management = transaction.enter_transaction_management
real_leave_transaction_management = transaction.leave_transaction_management
real_savepoint_commit = transaction.savepoint_commit
real_savepoint_rollback = transaction.savepoint_rollback
+real_managed = transaction.managed
def nop(*args, **kwargs):
return
@@ -45,6 +46,7 @@ def disable_transaction_methods():
transaction.savepoint_rollback = nop
transaction.enter_transaction_management = nop
transaction.leave_transaction_management = nop
+ transaction.managed = nop
def restore_transaction_methods():
transaction.commit = real_commit
@@ -53,6 +55,7 @@ def restore_transaction_methods():
transaction.savepoint_rollback = real_savepoint_rollback
transaction.enter_transaction_management = real_enter_transaction_management
transaction.leave_transaction_management = real_leave_transaction_management
+ transaction.managed = real_managed
class OutputChecker(doctest.OutputChecker):
def check_output(self, want, got, optionflags):