From 3e1bb5cfb8f9676e0c045f0d101a094437133b54 Mon Sep 17 00:00:00 2001
From: Tim Graham <timograham@gmail.com>
Date: Thu, 6 Aug 2015 12:55:10 -0400
Subject: [PATCH] Refs #14476 -- Added a test for default annotation name
 access in aggregate.

Fixed in f59fd15c4928caf3dfcbd50f6ab47be409a43b01
---
 tests/aggregation_regress/tests.py | 5 +++++
 1 file changed, 5 insertions(+)

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