diff --git a/tests/aggregation_regress/tests.py b/tests/aggregation_regress/tests.py
index 274dc29d6d..5aa9decf3a 100644
a
|
b
|
class AggregationTests(TestCase):
|
404 | 404 | Decimal('22.27'), places=2 |
405 | 405 | ) |
406 | 406 | |
407 | | def test_distinct_conditional_aggregate(self): |
| 407 | def test_distinct_conditional_aggregate_annotate(self): |
408 | 408 | self.assertEqual( |
409 | 409 | Book.objects.distinct().aggregate(test=Avg(Case( |
410 | 410 | When(price=Decimal('29.69'), then='pages'), |
… |
… |
class AggregationTests(TestCase):
|
412 | 412 | )))['test'], |
413 | 413 | 325 |
414 | 414 | ) |
| 415 | self.assertEqual( |
| 416 | Author.objects.annotate(num_exp_books=Count(Case( |
| 417 | When(book__price__gt=Decimal('25'), then=F('book__id')) |
| 418 | ), distinct=True)).first().num_exp_books, |
| 419 | 1 |
| 420 | ) |
415 | 421 | |
416 | 422 | def test_conditional_aggregate_on_complex_condition(self): |
417 | 423 | self.assertEqual( |