Kaydet (Commit) 84ad721b authored tarafından Chris Lamb's avatar Chris Lamb Kaydeden (comit) Tim Graham

Fixed #29275 -- Made assertFormError() output "(actual errors: none)" instead of…

Fixed #29275 -- Made assertFormError() output "(actual errors: none)" instead of "(actual errors: )".
üst 73cb62a3
...@@ -429,7 +429,7 @@ class SimpleTestCase(unittest.TestCase): ...@@ -429,7 +429,7 @@ class SimpleTestCase(unittest.TestCase):
msg_prefix + "The form '%s' in context %d does not" msg_prefix + "The form '%s' in context %d does not"
" contain the non-field error '%s'" " contain the non-field error '%s'"
" (actual errors: %s)" % " (actual errors: %s)" %
(form, i, err, non_field_errors) (form, i, err, non_field_errors or 'none')
) )
if not found_form: if not found_form:
self.fail(msg_prefix + "The form '%s' was not used to render the response" % form) self.fail(msg_prefix + "The form '%s' was not used to render the response" % form)
......
...@@ -631,7 +631,7 @@ class AssertFormErrorTests(SimpleTestCase): ...@@ -631,7 +631,7 @@ class AssertFormErrorTests(SimpleTestCase):
except AssertionError as e: except AssertionError as e:
self.assertIn( self.assertIn(
"The form 'form' in context 0 does not contain the non-field " "The form 'form' in context 0 does not contain the non-field "
"error 'Some error.' (actual errors: )", "error 'Some error.' (actual errors: none)",
str(e) str(e)
) )
try: try:
...@@ -639,7 +639,7 @@ class AssertFormErrorTests(SimpleTestCase): ...@@ -639,7 +639,7 @@ class AssertFormErrorTests(SimpleTestCase):
except AssertionError as e: except AssertionError as e:
self.assertIn( self.assertIn(
"abc: The form 'form' in context 0 does not contain the " "abc: The form 'form' in context 0 does not contain the "
"non-field error 'Some error.' (actual errors: )", "non-field error 'Some error.' (actual errors: none)",
str(e) str(e)
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment