Ticket #15624: 15624.test.diff

File 15624.test.diff, 938 bytes (added by Matthias Kestenholz, 13 years ago)
  • tests/regressiontests/aggregation_regress/tests.py

    diff --git a/tests/regressiontests/aggregation_regress/tests.py b/tests/regressiontests/aggregation_regress/tests.py
    index 0bb6899..233cd14 100644
    a b class AggregationTests(TestCase):  
    243243            'price__max': Decimal("82.80")
    244244        })
    245245
     246        # Regression for #15624 - Missing SELECT columns when using values, annotate
     247        # and aggregate in a single query
     248        self.assertEqual(
     249            Book.objects.annotate(c=Count('authors')).aggregate(Max('c')),
     250            {'c__max': 3}
     251            )
     252
     253        self.assertEqual(
     254            Book.objects.annotate(c=Count('authors')).values('c').aggregate(Max('c')),
     255            {'c__max': 3}
     256            )
     257
    246258    def test_field_error(self):
    247259        # Bad field requests in aggregates are caught and reported
    248260        self.assertRaises(
Back to Top