diff --git a/tests/aggregation/tests.py b/tests/aggregation/tests.py index a5914f18781..b6ba728e771 100644 --- a/tests/aggregation/tests.py +++ b/tests/aggregation/tests.py @@ -2365,6 +2365,7 @@ class AggregateAnnotationPruningTests(TestCase): ).aggregate(count=Count("id", filter=Q(id__in=[F("max_book_author"), 0]))) self.assertEqual(aggregates, {"count": 1}) + @skipUnlessDBFeature("supports_select_union") def test_aggregate_combined_queries(self): # Combined queries could have members in their values select mask while # others have them in their annotation mask which makes annotation diff --git a/tests/queries/test_explain.py b/tests/queries/test_explain.py index 44689aedf8a..67440cb5026 100644 --- a/tests/queries/test_explain.py +++ b/tests/queries/test_explain.py @@ -19,8 +19,11 @@ class ExplainTests(TestCase): Tag.objects.filter(name="test").prefetch_related("children"), Tag.objects.filter(name="test").annotate(Count("children")), Tag.objects.filter(name="test").values_list("name"), - Tag.objects.order_by().union(Tag.objects.order_by().filter(name="test")), ] + if connection.features.supports_select_union: + querysets.append( + Tag.objects.order_by().union(Tag.objects.order_by().filter(name="test")) + ) if connection.features.has_select_for_update: querysets.append(Tag.objects.select_for_update().filter(name="test")) supported_formats = connection.features.supported_explain_formats @@ -96,6 +99,7 @@ class ExplainTests(TestCase): option = "{} {}".format(name.upper(), "true" if value else "false") self.assertIn(option, captured_queries[0]["sql"]) + @skipUnlessDBFeature("supports_select_union") def test_multi_page_text_explain(self): if "TEXT" not in connection.features.supported_explain_formats: self.skipTest("This backend does not support TEXT format.") diff --git a/tests/queries/tests.py b/tests/queries/tests.py index ec88fa558de..45866fd50f1 100644 --- a/tests/queries/tests.py +++ b/tests/queries/tests.py @@ -1375,6 +1375,7 @@ class Queries1Tests(TestCase): self.assertCountEqual(items_after, [self.i2, self.i3, self.i4]) self.assertCountEqual(items_before, items_after) + @skipUnlessDBFeature("supports_select_union") def test_union_values_subquery(self): items = Item.objects.filter(creator=OuterRef("pk")) item_authors = Author.objects.annotate(is_creator=Exists(items)).order_by()