summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/queries/test_explain.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/queries/test_explain.py b/tests/queries/test_explain.py
index 9bf7de687a..f1108c062f 100644
--- a/tests/queries/test_explain.py
+++ b/tests/queries/test_explain.py
@@ -1,3 +1,4 @@
+import json
import unittest
import xml.etree.ElementTree
@@ -39,6 +40,13 @@ class ExplainTests(TestCase):
self.fail(
f'QuerySet.explain() result is not valid XML: {e}'
)
+ elif format == 'json':
+ try:
+ json.loads(result)
+ except json.JSONDecodeError as e:
+ self.fail(
+ f'QuerySet.explain() result is not valid JSON: {e}'
+ )
@skipUnlessDBFeature('validates_explain_options')
def test_unknown_options(self):