summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--django/test/testcases.py2
-rw-r--r--tests/test_client_regress/tests.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/django/test/testcases.py b/django/test/testcases.py
index a9a432fa21..8a85aa2a9f 100644
--- a/django/test/testcases.py
+++ b/django/test/testcases.py
@@ -429,7 +429,7 @@ class SimpleTestCase(unittest.TestCase):
msg_prefix + "The form '%s' in context %d does not"
" contain the non-field error '%s'"
" (actual errors: %s)" %
- (form, i, err, non_field_errors)
+ (form, i, err, non_field_errors or 'none')
)
if not found_form:
self.fail(msg_prefix + "The form '%s' was not used to render the response" % form)
diff --git a/tests/test_client_regress/tests.py b/tests/test_client_regress/tests.py
index b35bad43a2..00e1b01766 100644
--- a/tests/test_client_regress/tests.py
+++ b/tests/test_client_regress/tests.py
@@ -631,7 +631,7 @@ class AssertFormErrorTests(SimpleTestCase):
except AssertionError as e:
self.assertIn(
"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)
)
try:
@@ -639,7 +639,7 @@ class AssertFormErrorTests(SimpleTestCase):
except AssertionError as e:
self.assertIn(
"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)
)