From 3d734c09ff0138441dfe0a59010435871d17950f Mon Sep 17 00:00:00 2001 From: Simon Charette Date: Wed, 28 Sep 2022 00:44:46 -0400 Subject: Refs #33992 -- Refactored subquery grouping logic. This required moving the combined queries slicing logic to the compiler in order to allow Query.exists() to be called at expression resolving time. It allowed for Query.exists() to be called at Exists() initialization time and thus ensured that get_group_by_cols() was operating on the terminal representation of the query that only has a single column selected. --- tests/aggregation/tests.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/aggregation/tests.py b/tests/aggregation/tests.py index 5ec12ccd64..044dcdc690 100644 --- a/tests/aggregation/tests.py +++ b/tests/aggregation/tests.py @@ -1440,9 +1440,7 @@ class AggregateTestCase(TestCase): .annotate(cnt=Count("isbn")) .filter(cnt__gt=1) ) - query = publishers_having_more_than_one_book_qs.query.exists( - using=connection.alias - ) + query = publishers_having_more_than_one_book_qs.query.exists() _, _, group_by = query.get_compiler(connection=connection).pre_sql_setup() self.assertEqual(len(group_by), 1) -- cgit v1.3