1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Fixed test_relational_post_delete_signals_happen_before_parent_object when run in isolation.

This commit is contained in:
Mariusz Felisiak 2022-09-16 11:14:27 +02:00 committed by GitHub
parent 10178197d5
commit 229360d7ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -422,9 +422,9 @@ class DeletionTests(TestCase):
self.assertIs(type(instance), S)
deletions.append(instance.id)
r = R.objects.create(pk=1)
S.objects.create(pk=1, r=r)
r = R.objects.create()
s = S.objects.create(r=r)
s_id = s.pk
models.signals.post_delete.connect(log_post_delete, sender=S)
try:
@ -433,7 +433,7 @@ class DeletionTests(TestCase):
models.signals.post_delete.disconnect(log_post_delete)
self.assertEqual(len(deletions), 1)
self.assertEqual(deletions[0], 1)
self.assertEqual(deletions[0], s_id)
@skipUnlessDBFeature("can_defer_constraint_checks")
def test_can_defer_constraint_checks(self):