mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Refs #32226 -- Fixed JSON format of QuerySet.explain() on PostgreSQL when format is uppercased.
Follow up to aba9c2de66.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user