mirror of
https://github.com/django/django.git
synced 2025-03-31 19:46:42 +00:00
Fixed #33633 -- Skipped some test_utils tests on databases that don't support transactions.
This commit is contained in:
parent
24f442b91d
commit
1bb9bd9724
@ -41,6 +41,7 @@ class TestTestCase(TestCase):
|
|||||||
with self.assertRaisesMessage(DatabaseOperationForbidden, message):
|
with self.assertRaisesMessage(DatabaseOperationForbidden, message):
|
||||||
Car.objects.using("other").get()
|
Car.objects.using("other").get()
|
||||||
|
|
||||||
|
@skipUnlessDBFeature("supports_transactions")
|
||||||
def test_reset_sequences(self):
|
def test_reset_sequences(self):
|
||||||
old_reset_sequences = self.reset_sequences
|
old_reset_sequences = self.reset_sequences
|
||||||
self.reset_sequences = True
|
self.reset_sequences = True
|
||||||
@ -61,6 +62,10 @@ def assert_no_queries(test):
|
|||||||
return inner
|
return inner
|
||||||
|
|
||||||
|
|
||||||
|
# On databases with no transaction support (for instance, MySQL with the MyISAM
|
||||||
|
# engine), setUpTestData() is called before each test, so there is no need to
|
||||||
|
# clone class level test data.
|
||||||
|
@skipUnlessDBFeature("supports_transactions")
|
||||||
class TestDataTests(TestCase):
|
class TestDataTests(TestCase):
|
||||||
# setUpTestData re-assignment are also wrapped in TestData.
|
# setUpTestData re-assignment are also wrapped in TestData.
|
||||||
jim_douglas = None
|
jim_douglas = None
|
||||||
|
@ -2126,6 +2126,7 @@ class OverrideSettingsTests(SimpleTestCase):
|
|||||||
self.assertIn(expected_location, finder.locations)
|
self.assertIn(expected_location, finder.locations)
|
||||||
|
|
||||||
|
|
||||||
|
@skipUnlessDBFeature("supports_transactions")
|
||||||
class TestBadSetUpTestData(TestCase):
|
class TestBadSetUpTestData(TestCase):
|
||||||
"""
|
"""
|
||||||
An exception in setUpTestData() shouldn't leak a transaction which would
|
An exception in setUpTestData() shouldn't leak a transaction which would
|
||||||
@ -2160,6 +2161,7 @@ class TestBadSetUpTestData(TestCase):
|
|||||||
self.assertFalse(self._in_atomic_block)
|
self.assertFalse(self._in_atomic_block)
|
||||||
|
|
||||||
|
|
||||||
|
@skipUnlessDBFeature("supports_transactions")
|
||||||
class CaptureOnCommitCallbacksTests(TestCase):
|
class CaptureOnCommitCallbacksTests(TestCase):
|
||||||
databases = {"default", "other"}
|
databases = {"default", "other"}
|
||||||
callback_called = False
|
callback_called = False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user