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