summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/queries/test_explain.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/queries/test_explain.py b/tests/queries/test_explain.py
index 43ff0bdef3..7932eb14f2 100644
--- a/tests/queries/test_explain.py
+++ b/tests/queries/test_explain.py
@@ -41,14 +41,16 @@ class ExplainTests(TestCase):
)
self.assertIsInstance(result, str)
self.assertTrue(result)
- if format == "xml":
+ if not format:
+ continue
+ if format.lower() == "xml":
try:
xml.etree.ElementTree.fromstring(result)
except xml.etree.ElementTree.ParseError as e:
self.fail(
f"QuerySet.explain() result is not valid XML: {e}"
)
- elif format == "json":
+ elif format.lower() == "json":
try:
json.loads(result)
except json.JSONDecodeError as e: