Refs #14476 -- Added a test for default annotation name access in aggregate.

Fixed in f59fd15c49
This commit is contained in:
Tim Graham 2015-08-06 12:55:10 -04:00
parent 16a8d01308
commit 3e1bb5cfb8
1 changed files with 5 additions and 0 deletions

View File

@ -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):
"""