mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #15624 -- Made sure aggregations are present in SELECT
This commit is contained in:
parent
e01b5a5823
commit
e888a9b30d
3 changed files with 10 additions and 1 deletions
|
@ -250,6 +250,13 @@ class AggregationTests(TestCase):
|
|||
'price__max': Decimal("82.80")
|
||||
})
|
||||
|
||||
# Regression for #15624 - Missing SELECT columns when using values, annotate
|
||||
# and aggregate in a single query
|
||||
self.assertEqual(
|
||||
Book.objects.annotate(c=Count('authors')).values('c').aggregate(Max('c')),
|
||||
{'c__max': 3}
|
||||
)
|
||||
|
||||
def test_field_error(self):
|
||||
# Bad field requests in aggregates are caught and reported
|
||||
self.assertRaises(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue