diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2018-01-25 20:28:34 -0800 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2018-01-26 09:35:50 -0500 |
commit | 3187c89d6f8c60ca7e78093d5b37e0709e71cea9 (patch) | |
tree | e32778e48e76abceb01e29536e86d52f6c2fe641 /tests/aggregation_regress | |
parent | d0b44c44ef6ac8b6a7e332b83b9932f23dee41fd (diff) | |
download | django-3187c89d6f8c60ca7e78093d5b37e0709e71cea9.tar.gz |
Fixed #29067 -- Fixed regression in QuerySet.values_list(..., flat=True) followed by annotate().
Diffstat (limited to 'tests/aggregation_regress')
-rw-r--r-- | tests/aggregation_regress/tests.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/aggregation_regress/tests.py b/tests/aggregation_regress/tests.py index 91e993a6d1..9c8bac0d21 100644 --- a/tests/aggregation_regress/tests.py +++ b/tests/aggregation_regress/tests.py @@ -1475,6 +1475,11 @@ class AggregationTests(TestCase): vals2 = Book.objects.aggregate(result=Sum('rating') - Value(4.0)) self.assertEqual(vals1, vals2) + def test_annotate_values_list_flat(self): + """Find ages that are shared by at least two authors.""" + qs = Author.objects.values_list('age', flat=True).annotate(age_count=Count('age')).filter(age_count__gt=1) + self.assertSequenceEqual(qs, [29]) + class JoinPromotionTests(TestCase): def test_ticket_21150(self): |