1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Refs #32508 -- Raised ImproperlyConfigured/TypeError instead of using "assert".

This commit is contained in:
Mateo Radman
2021-07-02 19:33:48 +02:00
committed by Mariusz Felisiak
parent 1ff0ea6e9b
commit 2231429991
4 changed files with 28 additions and 4 deletions

View File

@@ -43,6 +43,16 @@ class TestTestCase(TestCase):
with self.assertRaisesMessage(AssertionError, message):
Car.objects.using('other').get()
def test_reset_sequences(self):
old_reset_sequences = self.reset_sequences
self.reset_sequences = True
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
class NonDeepCopyAble:
def __deepcopy__(self, memo):