summaryrefslogtreecommitdiff
path: root/tests/aggregation
diff options
context:
space:
mode:
Diffstat (limited to 'tests/aggregation')
-rw-r--r--tests/aggregation/tests.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/tests/aggregation/tests.py b/tests/aggregation/tests.py
index a759fd4d36..62704c4bd2 100644
--- a/tests/aggregation/tests.py
+++ b/tests/aggregation/tests.py
@@ -5,10 +5,10 @@ from decimal import Decimal
from django.core.exceptions import FieldError
from django.db import connection
from django.db.models import (
- Avg, Case, Count, DecimalField, DurationField, Exists, F, FloatField, Func,
+ Avg, Case, Count, DecimalField, DurationField, Exists, F, FloatField,
IntegerField, Max, Min, OuterRef, Subquery, Sum, Value, When,
)
-from django.db.models.functions import Coalesce
+from django.db.models.functions import Coalesce, Greatest
from django.test import TestCase
from django.test.testcases import skipUnlessDBFeature
from django.test.utils import Approximate, CaptureQueriesContext
@@ -1102,14 +1102,6 @@ class AggregateTestCase(TestCase):
{'books_per_rating__max': 3 + 5})
def test_expression_on_aggregation(self):
-
- # Create a plain expression
- class Greatest(Func):
- function = 'GREATEST'
-
- def as_sqlite(self, compiler, connection, **extra_context):
- return super().as_sql(compiler, connection, function='MAX', **extra_context)
-
qs = Publisher.objects.annotate(
price_or_median=Greatest(Avg('book__rating', output_field=DecimalField()), Avg('book__price'))
).filter(price_or_median__gte=F('num_awards')).order_by('num_awards')