                              except xml.etree.ElementTree.ParseError as e:
                                  self.fail(
                                      f'QuerySet.explain() result is not valid XML: {e}'
                                  )
  
      @skipUnlessDBFeature('validates_explain_options')
      def test_unknown_options(self):
          with self.assertRaisesMessage(ValueError, 'Unknown options: test, test2'):
 
</s> remove                 yield ' '.join(str(c) for c in row)
 </s> add                 yield ' '.join(output_formatter(c) for c in row)
                        elif format == 'json':
                            try:
                                json.loads(result)
                            except json.JSONDecodeError as e:
                                self.fail(
                                    f'QuerySet.explain() result is not valid JSON: {e}'
                                )
                              except xml.etree.ElementTree.ParseError as e:
                                  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):
          with self.assertRaisesMessage(ValueError, 'Unknown options: test, test2'):
keep keep keep add keep keep keep keep
 Fixed #32226 -- Fixed JSON format of QuerySet.explain() on PostgreSQL. 
tests/queries/test_explain.py