Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
  • Loading branch information...
commit d463580c1bbc17c6180d2f9638768769e850d8d0 1 parent 6c15b5d
Karen Tracey authored April 22, 2009

Showing 1 changed file with 3 additions and 0 deletions. Show diff stats Hide diff stats

  1. 3  django/test/testcases.py
3  django/test/testcases.py
@@ -34,6 +34,7 @@ def to_list(value):
34 34
 real_leave_transaction_management = transaction.leave_transaction_management
35 35
 real_savepoint_commit = transaction.savepoint_commit
36 36
 real_savepoint_rollback = transaction.savepoint_rollback
  37
+real_managed = transaction.managed
37 38
 
38 39
 def nop(*args, **kwargs):
39 40
     return
@@ -45,6 +46,7 @@ def disable_transaction_methods():
45 46
     transaction.savepoint_rollback = nop
46 47
     transaction.enter_transaction_management = nop
47 48
     transaction.leave_transaction_management = nop
  49
+    transaction.managed = nop
48 50
 
49 51
 def restore_transaction_methods():
50 52
     transaction.commit = real_commit
@@ -53,6 +55,7 @@ def restore_transaction_methods():
53 55
     transaction.savepoint_rollback = real_savepoint_rollback
54 56
     transaction.enter_transaction_management = real_enter_transaction_management
55 57
     transaction.leave_transaction_management = real_leave_transaction_management
  58
+    transaction.managed = real_managed
56 59
 
57 60
 class OutputChecker(doctest.OutputChecker):
58 61
     def check_output(self, want, got, optionflags):

0 notes on commit d463580

Please sign in to comment.
Something went wrong with that request. Please try again.