          self.assertEqual(errors, control)
  
          errors = json.loads(form.errors.as_json(escape_html=True))
          control['__all__'][0]['message'] = escaped_error
          self.assertEqual(errors, control)
  
      def test_error_list(self):
 
</s> remove         errors = json.loads(form.errors.as_json())
 </s> add         errors = form.errors.get_json_data() </s> remove         return json.dumps({f: e.get_json_data(escape_html) for f, e in self.items()})
 </s> add         return json.dumps(self.get_json_data(escape_html))
        escaped_error = '&lt;p&gt;Non-field error.&lt;/p&gt;'
        self.assertEqual(
            form.errors.get_json_data(escape_html=True)['__all__'][0]['message'],
            escaped_error
        )
          self.assertEqual(errors, control)
  
        escaped_error = '&lt;p&gt;Non-field error.&lt;/p&gt;'
        self.assertEqual(
            form.errors.get_json_data(escape_html=True)['__all__'][0]['message'],
            escaped_error
        )
          errors = json.loads(form.errors.as_json(escape_html=True))
          control['__all__'][0]['message'] = escaped_error
          self.assertEqual(errors, control)
  
      def test_error_list(self):
keep add keep keep keep keep keep
 Fixed #27922 -- Added ErrorDict.get_json_data(). 
tests/forms_tests/tests/test_forms.py