From cbb6531e5bef7ffe0c46d6c44d598d7bcdf9029e Mon Sep 17 00:00:00 2001 From: Taoup Date: Tue, 18 Feb 2020 15:20:55 +0800 Subject: Fixed #31228 -- Reallowed aggregates to be used with multiple expressions and no DISTINCT on SQLite. Regression in bc05547cd8c1dd511c6b6a6c873a1bc63417b111. Thanks Andy Terra for the report. --- tests/backends/sqlite/tests.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/backends/sqlite/tests.py') diff --git a/tests/backends/sqlite/tests.py b/tests/backends/sqlite/tests.py index c26377c8af..3898c8f13c 100644 --- a/tests/backends/sqlite/tests.py +++ b/tests/backends/sqlite/tests.py @@ -63,6 +63,15 @@ class Tests(TestCase): with self.assertRaisesMessage(NotSupportedError, msg): connection.ops.check_expression_support(aggregate) + def test_distinct_aggregation_multiple_args_no_distinct(self): + # Aggregate functions accept multiple arguments when DISTINCT isn't + # used, e.g. GROUP_CONCAT(). + class DistinctAggregate(Aggregate): + allow_distinct = True + + aggregate = DistinctAggregate('first', 'second', distinct=False) + connection.ops.check_expression_support(aggregate) + def test_memory_db_test_name(self): """A named in-memory db should be allowed where supported.""" from django.db.backends.sqlite3.base import DatabaseWrapper -- cgit v1.3