From 493b26bbfc9cc0ad223ece131741cba2312ced0f Mon Sep 17 00:00:00 2001 From: "Ahmad A. Hussein" Date: Fri, 14 Aug 2020 22:07:37 +0200 Subject: Fixed #31888 -- Avoided module-level MySQL queries in tests. --- tests/aggregation/tests.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'tests/aggregation') diff --git a/tests/aggregation/tests.py b/tests/aggregation/tests.py index c738cbb27e..1f6baa70ff 100644 --- a/tests/aggregation/tests.py +++ b/tests/aggregation/tests.py @@ -1,7 +1,6 @@ import datetime import re from decimal import Decimal -from unittest import skipIf from django.core.exceptions import FieldError from django.db import connection @@ -1204,16 +1203,16 @@ class AggregateTestCase(TestCase): ]) @skipUnlessDBFeature('supports_subqueries_in_group_by') - @skipIf( - connection.vendor == 'mysql' and 'ONLY_FULL_GROUP_BY' in connection.sql_mode, - 'GROUP BY optimization does not work properly when ONLY_FULL_GROUP_BY ' - 'mode is enabled on MySQL, see #31331.', - ) def test_aggregation_subquery_annotation_multivalued(self): """ Subquery annotations must be included in the GROUP BY if they use potentially multivalued relations (contain the LOOKUP_SEP). """ + if connection.vendor == 'mysql' and 'ONLY_FULL_GROUP_BY' in connection.sql_mode: + self.skipTest( + 'GROUP BY optimization does not work properly when ' + 'ONLY_FULL_GROUP_BY mode is enabled on MySQL, see #31331.' + ) subquery_qs = Author.objects.filter( pk=OuterRef('pk'), book__name=OuterRef('book__name'), -- cgit v1.3