summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Wobrock <david.wobrock@gmail.com>2022-08-24 21:14:32 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-08-27 15:36:13 +0200
commitfca055315e9bb6cb1212953478dbe971b0bb47fb (patch)
tree745be0b5923ed6a852bb7a81896c24e3831c2517 /tests
parent0890719402c79e3d68bea8b01a9d57ac07d51af8 (diff)
[4.1.x] Fixed #33952 -- Reallowed creating reverse foreign key managers on unsaved instances.
Thanks Claude Paroz for the report. Regression in 7ba6ebe9149ae38257d70100e8bfbfd0da189862. Backport of 806e9e2d0dcf8f58e376fb7e2a8b9771e2a9ce16 from main
Diffstat (limited to 'tests')
-rw-r--r--tests/many_to_one/tests.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/many_to_one/tests.py b/tests/many_to_one/tests.py
index 2311834481..1cab63c3b6 100644
--- a/tests/many_to_one/tests.py
+++ b/tests/many_to_one/tests.py
@@ -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):