1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #33952 -- Reallowed creating reverse foreign key managers on unsaved instances.

Thanks Claude Paroz for the report.

Regression in 7ba6ebe914.
This commit is contained in:
David Wobrock
2022-08-24 21:14:32 +02:00
committed by Mariusz Felisiak
parent 0701bb8e1f
commit 806e9e2d0d
3 changed files with 14 additions and 9 deletions

View File

@@ -758,6 +758,9 @@ class ManyToOneTests(TestCase):
)
with self.assertRaisesMessage(ValueError, msg):
th.child_set.count()
# The reverse foreign key manager can be created.
self.assertEqual(th.child_set.model, Third)
th.save()
# Now the model is saved, so we will need to execute a query.
with self.assertNumQueries(1):