Skip to content

Commit 229d026

Browse files
varunkasyapjacobtylerwalls
authored andcommitted
Fixed #36883 -- Split monolithic aggregation regression tests.
1 parent e92d1e3 commit 229d026

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

tests/aggregation_regress/tests.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ def test_empty(self):
849849
],
850850
)
851851

852-
def test_more_more(self):
852+
def test_order_by_group_by_join(self):
853853
# Regression for #10113 - Fields mentioned in order_by() must be
854854
# included in the GROUP BY. This only becomes a problem when the
855855
# order_by introduces a new join.
@@ -869,6 +869,7 @@ def test_more_more(self):
869869
lambda b: b.name,
870870
)
871871

872+
def test_annotate_select_related(self):
872873
# Regression for #10127 - Empty select_related() works with annotate
873874
qs = (
874875
Book.objects.filter(rating__lt=4.5)
@@ -897,6 +898,7 @@ def test_more_more(self):
897898
lambda b: (b.name, b.authors__age__avg, b.publisher.name, b.contact.name),
898899
)
899900

901+
def test_values_extra_grouping(self):
900902
# Regression for #10132 - If the values() clause only mentioned extra
901903
# (select=) columns, those columns are used for grouping
902904
qs = (
@@ -931,6 +933,7 @@ def test_more_more(self):
931933
],
932934
)
933935

936+
def test_aggregate_subquery_annotation(self):
934937
# Regression for #10182 - Queries with aggregate calls are correctly
935938
# realiased when used in a subquery
936939
ids = (
@@ -947,6 +950,7 @@ def test_more_more(self):
947950
lambda b: b.name,
948951
)
949952

953+
def test_group_by_field_uniqueness(self):
950954
# Regression for #15709 - Ensure each group_by field only exists once
951955
# per query
952956
qstr = str(
@@ -1046,7 +1050,7 @@ def test_pickle(self):
10461050
query,
10471051
)
10481052

1049-
def test_more_more_more(self):
1053+
def test_aggregate_cloning(self):
10501054
# Regression for #10199 - Aggregate calls clone the original query so
10511055
# the original query can still be used
10521056
books = Book.objects.all()
@@ -1065,6 +1069,7 @@ def test_more_more_more(self):
10651069
lambda b: b.name,
10661070
)
10671071

1072+
def test_annotate_with_dates(self):
10681073
# Regression for #10248 - Annotations work with dates()
10691074
qs = (
10701075
Book.objects.annotate(num_authors=Count("authors"))
@@ -1079,6 +1084,7 @@ def test_more_more_more(self):
10791084
],
10801085
)
10811086

1087+
def test_extra_select_grouping_with_params(self):
10821088
# Regression for #10290 - extra selects with parameters can be used for
10831089
# grouping.
10841090
qs = (
@@ -1091,6 +1097,7 @@ def test_more_more_more(self):
10911097
qs, [150, 175, 224, 264, 473, 566], lambda b: int(b["sheets"])
10921098
)
10931099

1100+
def test_annotate_and_count(self):
10941101
# Regression for 10425 - annotations don't get in the way of a count()
10951102
# clause
10961103
self.assertEqual(
@@ -1100,6 +1107,7 @@ def test_more_more_more(self):
11001107
Book.objects.annotate(Count("publisher")).values("publisher").count(), 6
11011108
)
11021109

1110+
def test_annotate_ordering_by_annotation_and_filtering(self):
11031111
# Note: intentionally no order_by(), that case needs tests, too.
11041112
publishers = Publisher.objects.filter(id__in=[self.p1.id, self.p2.id])
11051113
self.assertEqual(sorted(p.name for p in publishers), ["Apress", "Sams"])
@@ -1123,6 +1131,7 @@ def test_more_more_more(self):
11231131
)
11241132
self.assertEqual(sorted(p.name for p in publishers), ["Apress", "Sams"])
11251133

1134+
def test_inherited_fields_aggregation(self):
11261135
# Regression for 10666 - inherited fields work with annotations and
11271136
# aggregations
11281137
self.assertEqual(
@@ -1175,6 +1184,7 @@ def test_more_more_more(self):
11751184
],
11761185
)
11771186

1187+
def test_aggregate_referencing_aggregate(self):
11781188
# Regression for #10766 - Shouldn't be able to reference an aggregate
11791189
# fields in an aggregate() call.
11801190
msg = "Cannot compute Avg('mean_age'): 'mean_age' is an aggregate"

0 commit comments

Comments
 (0)