summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2012-01-07 10:26:29 +0000
committerAymeric Augustin <aymeric.augustin@m4x.org>2012-01-07 10:26:29 +0000
commit56b37bf1cfcff2ca077cc73e6bf88ba66d0cf642 (patch)
tree03b923ac8e0b58f2fcaeb4b0e8075c9f3c698f1b /django
parent4629668ffacddb0b8ddb5d8cc7fb8d01f039a4e3 (diff)
Fixed #17499 -- Ensured assertFieldOutput works for fields that customize the "required" error message. Thanks dpifke for the report and patch, and claudep for the tests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17345 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/test/testcases.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/test/testcases.py b/django/test/testcases.py
index 4de4750aee..53ea02a4f0 100644
--- a/django/test/testcases.py
+++ b/django/test/testcases.py
@@ -31,7 +31,7 @@ from django.test.client import Client
from django.test.utils import (get_warnings_state, restore_warnings_state,
override_settings)
from django.utils import simplejson, unittest as ut2
-from django.utils.encoding import smart_str
+from django.utils.encoding import smart_str, force_unicode
from django.views.static import serve
__all__ = ('DocTestRunner', 'OutputChecker', 'TestCase', 'TransactionTestCase',
@@ -335,7 +335,7 @@ class SimpleTestCase(ut2.TestCase):
optional.clean(input)
self.assertEqual(context_manager.exception.messages, errors)
# test required inputs
- error_required = [u'This field is required.']
+ error_required = [force_unicode(required.error_messages['required'])]
for e in EMPTY_VALUES:
with self.assertRaises(ValidationError) as context_manager:
required.clean(e)