Refs #35744 -- Removed problematic __in lookup in test_intersection_in_nested_subquery.

It's problematic on MongoDB. Simon: "It seems odd that we'd use
__in=OuterRef("pk") over __in=[OuterRef("pk")]. It's a SQLism that
only works because right-hand-side is wrapped with (...) and that's
interpreted as a singleton tuple which is allowed with IN."
This commit is contained in:
Tim Graham
2026-01-26 20:40:11 -05:00
committed by Jacob Walls
parent b30e09a942
commit 5d5f95da40

View File

@@ -512,12 +512,7 @@ class QuerySetSetOperationTests(TestCase):
tags.filter(id=OuterRef(OuterRef("tag_id")))
)
qs = Note.objects.filter(
Exists(
Annotation.objects.filter(
Exists(tags),
notes__in=OuterRef("pk"),
)
)
Exists(Annotation.objects.filter(Exists(tags), notes=OuterRef("pk")))
)
self.assertIsNone(qs.first())
annotation.notes.add(note)