Added supports_select_union skips in queries and aggregation tests.

This commit is contained in:
Tim Graham 2024-08-20 10:29:35 -04:00 committed by nessita
parent cdcd604ef8
commit 6a85c888bf
3 changed files with 7 additions and 1 deletions

View file

@ -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.")