summaryrefslogtreecommitdiff
path: root/tests/aggregation_regress
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-08-06 12:55:10 -0400
committerTim Graham <timograham@gmail.com>2015-08-06 13:52:26 -0400
commit3e1bb5cfb8f9676e0c045f0d101a094437133b54 (patch)
treedbc42ff773d9e162b642c1cfbfa6d4c3d4bbb8ec /tests/aggregation_regress
parent16a8d01308f8ca4a7b4673424059424ba3fe36c8 (diff)
Refs #14476 -- Added a test for default annotation name access in aggregate.
Fixed in f59fd15c4928caf3dfcbd50f6ab47be409a43b01
Diffstat (limited to 'tests/aggregation_regress')
-rw-r--r--tests/aggregation_regress/tests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/aggregation_regress/tests.py b/tests/aggregation_regress/tests.py
index 1e680dbdd9..44c0f0c07f 100644
--- a/tests/aggregation_regress/tests.py
+++ b/tests/aggregation_regress/tests.py
@@ -1014,6 +1014,11 @@ class AggregationTests(TestCase):
['Peter Norvig'],
lambda b: b.name
)
+ # Referencing the auto-generated name in an aggregate() also works.
+ self.assertEqual(
+ Author.objects.annotate(Count('book')).aggregate(Max('book__count')),
+ {'book__count__max': 2}
+ )
def test_annotate_joins(self):
"""