mirror of
https://github.com/django/django.git
synced 2025-11-23 12:26:57 +00:00
Fixed #34570 -- Silenced noop deferral of many-to-many and GFK.
While deferring many-to-many and GFK has no effect, the previous
implementation of QuerySet.defer() ignore them instead of crashing.
Regression in b3db6c8dcb.
Thanks Paco Martínez for the report.
This commit is contained in:
parent
0ec60661e6
commit
99e5dff737
3 changed files with 19 additions and 1 deletions
|
|
@ -271,6 +271,12 @@ class DeferRegressionTest(TestCase):
|
|||
with self.assertNumQueries(1):
|
||||
self.assertEqual(leaf.second_child.value, 64)
|
||||
|
||||
def test_defer_many_to_many_ignored(self):
|
||||
location = Location.objects.create()
|
||||
request = Request.objects.create(location=location)
|
||||
with self.assertNumQueries(1):
|
||||
self.assertEqual(Request.objects.defer("items").get(), request)
|
||||
|
||||
|
||||
class DeferDeletionSignalsTests(TestCase):
|
||||
senders = [Item, Proxy]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue