mirror of
https://github.com/django/django.git
synced 2025-11-20 03:30:00 +00:00
Refs #35660 -- Updated TransactionTestCase methods into class or static methods.
This commit is contained in:
parent
d2c97981fb
commit
8eca3e9bce
2 changed files with 42 additions and 39 deletions
|
|
@ -65,14 +65,12 @@ class TestTestCase(TestCase):
|
|||
|
||||
@skipUnlessDBFeature("supports_transactions")
|
||||
def test_reset_sequences(self):
|
||||
old_reset_sequences = self.reset_sequences
|
||||
self.reset_sequences = True
|
||||
old_reset_sequences = self.__class__.reset_sequences
|
||||
self.__class__.reset_sequences = True
|
||||
self.addCleanup(setattr, self.__class__, "reset_sequences", old_reset_sequences)
|
||||
msg = "reset_sequences cannot be used on TestCase instances"
|
||||
try:
|
||||
with self.assertRaisesMessage(TypeError, msg):
|
||||
self._fixture_setup()
|
||||
finally:
|
||||
self.reset_sequences = old_reset_sequences
|
||||
with self.assertRaisesMessage(TypeError, msg):
|
||||
self._fixture_setup()
|
||||
|
||||
|
||||
def assert_no_queries(test):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue