mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #31251 -- Disabled grouping by OuterRef() annotation.
This commit is contained in:
@@ -687,6 +687,14 @@ class BasicExpressionsTests(TestCase):
|
||||
[self.foobar_ltd.ceo],
|
||||
)
|
||||
|
||||
def test_subquery_group_by_outerref_in_filter(self):
|
||||
inner = Company.objects.annotate(
|
||||
employee=OuterRef('pk'),
|
||||
).values('employee').annotate(
|
||||
min_num_chairs=Min('num_chairs'),
|
||||
).values('ceo')
|
||||
self.assertIs(Employee.objects.filter(pk__in=Subquery(inner)).exists(), True)
|
||||
|
||||
def test_case_in_filter_if_boolean_output_field(self):
|
||||
is_ceo = Company.objects.filter(ceo=OuterRef('pk'))
|
||||
is_poc = Company.objects.filter(point_of_contact=OuterRef('pk'))
|
||||
|
||||
Reference in New Issue
Block a user