mirror of
https://github.com/django/django.git
synced 2025-10-25 06:36:07 +00:00
[5.2.x] Fixed #36149 -- Allowed subquery values against tuple exact and in lookups.
Non-tuple exact and in lookups have specialized logic for subqueries that can
be adapted to properly assign select mask if unspecified and ensure the number
of involved members are matching on both side of the operator.
Backport of 41239fe34d from main.
This commit is contained in:
committed by
Sarah Boyce
parent
f8fce8d4dc
commit
dc1c9b4ddd
@@ -922,20 +922,6 @@ class Queries1Tests(TestCase):
|
||||
[self.t2, self.t3],
|
||||
)
|
||||
|
||||
# Multi-valued values() and values_list() querysets should raise errors.
|
||||
with self.assertRaisesMessage(
|
||||
TypeError, "Cannot use multi-field values as a filter value."
|
||||
):
|
||||
Tag.objects.filter(
|
||||
name__in=Tag.objects.filter(parent=self.t1).values("name", "id")
|
||||
)
|
||||
with self.assertRaisesMessage(
|
||||
TypeError, "Cannot use multi-field values as a filter value."
|
||||
):
|
||||
Tag.objects.filter(
|
||||
name__in=Tag.objects.filter(parent=self.t1).values_list("name", "id")
|
||||
)
|
||||
|
||||
def test_ticket9985(self):
|
||||
# qs.values_list(...).values(...) combinations should work.
|
||||
self.assertSequenceEqual(
|
||||
|
||||
Reference in New Issue
Block a user