summaryrefslogtreecommitdiff
path: root/tests/delete_regress
diff options
context:
space:
mode:
authorAnssi Kääriäinen <akaariai@gmail.com>2013-02-20 03:11:54 +0200
committerAnssi Kääriäinen <akaariai@gmail.com>2013-02-27 17:54:27 +0200
commit50328f0a618674b7143d86acaa7016c5293e9774 (patch)
treee178109ebf08a5f3d37aa0c79a6d4b88db4cc898 /tests/delete_regress
parent210894167799780283101636c99d8010b30bf09c (diff)
downloaddjango-50328f0a618674b7143d86acaa7016c5293e9774.tar.gz
Fixed #19861 -- Transaction ._dirty flag improvement
There were a couple of errors in ._dirty flag handling: * It started as None, but was never reset to None. * The _dirty flag was sometimes used to indicate if the connection was inside transaction management, but this was not done consistently. This also meant the flag had three separate values. * The None value had a special meaning, causing for example inability to commit() on new connection unless enter/leave tx management was done. * The _dirty was tracking "connection in transaction" state, but only in managed transactions. * Some tests never reset the transaction state of the used connection. * And some additional less important changes. This commit has some potential for regressions, but as the above list shows, the current situation isn't perfect either.
Diffstat (limited to 'tests/delete_regress')
-rw-r--r--tests/delete_regress/tests.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/delete_regress/tests.py b/tests/delete_regress/tests.py
index e007ebdd76..9fcc19ba71 100644
--- a/tests/delete_regress/tests.py
+++ b/tests/delete_regress/tests.py
@@ -23,11 +23,13 @@ class DeleteLockingTest(TransactionTestCase):
# Put both DB connections into managed transaction mode
transaction.enter_transaction_management()
transaction.managed(True)
- self.conn2._enter_transaction_management(True)
+ self.conn2.enter_transaction_management()
+ self.conn2.managed(True)
def tearDown(self):
# Close down the second connection.
transaction.leave_transaction_management()
+ self.conn2.abort()
self.conn2.close()
@skipUnlessDBFeature('test_db_allows_multiple_connections')