mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[4.1.x] Fixed #33952 -- Reallowed creating reverse foreign key managers on unsaved instances.
Thanks Claude Paroz for the report. Regression in7ba6ebe914. Backport of806e9e2d0dfrom main
This commit is contained in:
committed by
Mariusz Felisiak
parent
0890719402
commit
fca055315e
@@ -748,6 +748,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):
|
||||
|
||||
Reference in New Issue
Block a user