From 03c0a3de722c4a7de9f3edfeb26417ebc8b90fe9 Mon Sep 17 00:00:00 2001 From: Simon Charette Date: Thu, 31 Oct 2024 09:05:58 -0400 Subject: [PATCH] Refs #373 -- Used a feature flag to disable composite subquery test on MySQL. --- tests/foreign_object/test_tuple_lookups.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/foreign_object/test_tuple_lookups.py b/tests/foreign_object/test_tuple_lookups.py index 06182d3bb5..499329e7ca 100644 --- a/tests/foreign_object/test_tuple_lookups.py +++ b/tests/foreign_object/test_tuple_lookups.py @@ -1,7 +1,6 @@ import itertools -import unittest -from django.db import NotSupportedError, connection +from django.db import NotSupportedError from django.db.models import F from django.db.models.fields.tuple_lookups import ( TupleExact, @@ -12,7 +11,7 @@ from django.db.models.fields.tuple_lookups import ( TupleLessThan, TupleLessThanOrEqual, ) -from django.test import TestCase +from django.test import TestCase, skipUnlessDBFeature from .models import Contact, Customer @@ -119,10 +118,7 @@ class TupleLookupsTests(TestCase): Contact.objects.filter(lookup).order_by("id"), contacts ) - @unittest.skipIf( - connection.vendor == "mysql", - "MySQL doesn't support LIMIT & IN/ALL/ANY/SOME subquery", - ) + @skipUnlessDBFeature("allow_sliced_subqueries_with_in") def test_in_subquery(self): subquery = Customer.objects.filter(id=self.customer_1.id)[:1] self.assertSequenceEqual(