mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Enabled autocommit for PostgreSQL.
For users who didn't activate autocommit in their database options, this is backwards-incompatible in "non-managed" aka "auto" transaction state. This state now uses database-level autocommit instead of ORM-level autocommit. Also removed the uses_autocommit feature which lost its purpose.
This commit is contained in:
@@ -22,6 +22,7 @@ from django.test.utils import override_settings
|
||||
from django.utils import six
|
||||
from django.utils.encoding import force_str
|
||||
from django.utils.six.moves import xrange
|
||||
from django.utils.unittest import expectedFailure
|
||||
|
||||
from .models import Band
|
||||
|
||||
@@ -698,6 +699,10 @@ class TransactionMiddlewareTest(TransactionTestCase):
|
||||
self.assertFalse(transaction.is_dirty())
|
||||
self.assertEqual(Band.objects.count(), 1)
|
||||
|
||||
# TODO: update this test to account for database-level autocommit.
|
||||
# Currently it fails under PostgreSQL because connections are never
|
||||
# marked dirty in non-managed mode.
|
||||
@expectedFailure
|
||||
def test_unmanaged_response(self):
|
||||
transaction.enter_transaction_management(False)
|
||||
self.assertEqual(Band.objects.count(), 0)
|
||||
|
||||
Reference in New Issue
Block a user