From 275dd4ebbabbbe758c7219a3d666953d5a7b072f Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Thu, 10 Dec 2020 18:00:57 +0100 Subject: Fixed #32178 -- Allowed database backends to skip tests and mark expected failures. Co-authored-by: Tim Graham --- tests/annotations/tests.py | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'tests/annotations') diff --git a/tests/annotations/tests.py b/tests/annotations/tests.py index cc9bd82656..8337f344ed 100644 --- a/tests/annotations/tests.py +++ b/tests/annotations/tests.py @@ -2,7 +2,6 @@ import datetime from decimal import Decimal from django.core.exceptions import FieldDoesNotExist, FieldError -from django.db import connection from django.db.models import ( BooleanField, Case, CharField, Count, DateTimeField, DecimalField, Exists, ExpressionWrapper, F, FloatField, Func, IntegerField, Max, @@ -20,19 +19,6 @@ from .models import ( ) -def cxOracle_py3_bug(func): - """ - There's a bug in Django/cx_Oracle with respect to string handling under - Python 3 (essentially, they treat Python 3 strings as Python 2 strings - rather than unicode). This makes some tests here fail under Python 3, so - we mark them as expected failures until someone fixes them in #23843. - """ - from unittest import expectedFailure - - from django.db import connection - return expectedFailure(func) if connection.vendor == 'oracle' else func - - class NonAggregateAnnotationTestCase(TestCase): @classmethod @@ -590,7 +576,6 @@ class NonAggregateAnnotationTestCase(TestCase): e.id, e.first_name, e.manager, e.random_value, e.last_name, e.age, e.salary, e.store.name, e.annotated_value)) - @cxOracle_py3_bug def test_custom_functions(self): Company(name='Apple', motto=None, ticker_name='APPL', description='Beautiful Devices').save() Company(name='Django Software Foundation', motto=None, ticker_name=None, description=None).save() @@ -617,7 +602,6 @@ class NonAggregateAnnotationTestCase(TestCase): lambda c: (c.name, c.tagline) ) - @cxOracle_py3_bug def test_custom_functions_can_ref_other_functions(self): Company(name='Apple', motto=None, ticker_name='APPL', description='Beautiful Devices').save() Company(name='Django Software Foundation', motto=None, ticker_name=None, description=None).save() @@ -770,11 +754,6 @@ class NonAggregateAnnotationTestCase(TestCase): ]) 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)), -- cgit v1.3