mirror of
https://github.com/django/django.git
synced 2025-10-30 00:56:09 +00:00
[2.0.x] Fixed #29067 -- Fixed regression in QuerySet.values_list(..., flat=True) followed by annotate().
Regression in4dfd6b88d5. Backport of3187c89d6ffrom master
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user