diff options
| author | Tim Graham <timograham@gmail.com> | 2024-08-20 10:29:35 -0400 |
|---|---|---|
| committer | nessita <124304+nessita@users.noreply.github.com> | 2024-08-26 12:53:08 -0300 |
| commit | 6a85c888bff84134ed674ddfef935e0a9906fc9f (patch) | |
| tree | ac57fe4bdb172a4629894e35f3701b467f3c0549 /tests/queries | |
| parent | cdcd604ef8f650533eff6bd63a517ebb4ffddf96 (diff) | |
Added supports_select_union skips in queries and aggregation tests.
Diffstat (limited to 'tests/queries')
| -rw-r--r-- | tests/queries/test_explain.py | 6 | ||||
| -rw-r--r-- | tests/queries/tests.py | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/tests/queries/test_explain.py b/tests/queries/test_explain.py index 44689aedf8..67440cb502 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 ec88fa558d..45866fd50f 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() |
