diff options
author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-04-19 08:24:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-19 08:24:24 +0200 |
commit | f4f2afeb457429f55d6325ed557f8e92a74ee028 (patch) | |
tree | 266fcd7150fa098feddffcb85a53eaf9431fbf41 /tests/queries | |
parent | 903702dfb1461cbb4ab93f841651e6882a72d337 (diff) | |
download | django-f4f2afeb457429f55d6325ed557f8e92a74ee028.tar.gz |
Refs #32226 -- Fixed JSON format of QuerySet.explain() on PostgreSQL when format is uppercased.
Follow up to aba9c2de669dcc0278c7ffde7981be91801be00b.
Diffstat (limited to 'tests/queries')
-rw-r--r-- | tests/queries/test_explain.py | 6 |
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: |