summaryrefslogtreecommitdiff
path: root/tests/annotations
diff options
context:
space:
mode:
authorAhmad A. Hussein <ahmadahussein0@gmail.com>2020-08-14 22:07:37 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-08-17 09:31:16 +0200
commit493b26bbfc9cc0ad223ece131741cba2312ced0f (patch)
tree0a3ac47beb49583e13a904983e90cd1c31c337d2 /tests/annotations
parent632ccffc49658de5348c51a8918719364be54f37 (diff)
downloaddjango-493b26bbfc9cc0ad223ece131741cba2312ced0f.tar.gz
Fixed #31888 -- Avoided module-level MySQL queries in tests.
Diffstat (limited to 'tests/annotations')
-rw-r--r--tests/annotations/tests.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/annotations/tests.py b/tests/annotations/tests.py
index 3bf6a22bac..3d00a02a11 100644
--- a/tests/annotations/tests.py
+++ b/tests/annotations/tests.py
@@ -1,6 +1,5 @@
import datetime
from decimal import Decimal
-from unittest import skipIf
from django.core.exceptions import FieldDoesNotExist, FieldError
from django.db import connection
@@ -647,12 +646,12 @@ class NonAggregateAnnotationTestCase(TestCase):
datetime.date(2008, 11, 3),
])
- @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_annotation_aggregate_with_m2o(self):
+ 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.'
+ )
qs = Author.objects.filter(age__lt=30).annotate(
max_pages=Case(
When(book_contact_set__isnull=True, then=Value(0)),