diff options
| author | Gary Wilson Jr <gary.wilson@gmail.com> | 2007-10-28 05:40:26 +0000 |
|---|---|---|
| committer | Gary Wilson Jr <gary.wilson@gmail.com> | 2007-10-28 05:40:26 +0000 |
| commit | 26ea06b0ab423348e40652dd9e3f530a08b93582 (patch) | |
| tree | 093c1c41f35cb5554b53f310ab08cd5292746ee7 /tests/regressiontests/forms/util.py | |
| parent | ee49e934d96db3492e69fdce0a3096ef9b0ec8e0 (diff) | |
Fixed #3457 -- Allow overridding of error messages for newforms Fields.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6625 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/forms/util.py')
| -rw-r--r-- | tests/regressiontests/forms/util.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/regressiontests/forms/util.py b/tests/regressiontests/forms/util.py index 4f81709082..bfaf73f6bc 100644 --- a/tests/regressiontests/forms/util.py +++ b/tests/regressiontests/forms/util.py @@ -42,4 +42,11 @@ u'' # Can take a mixture in a list. >>> print ValidationError(["First error.", u"Not \u03C0.", ugettext_lazy("Error.")]).messages <ul class="errorlist"><li>First error.</li><li>Not π.</li><li>Error.</li></ul> + +>>> class VeryBadError: +... def __unicode__(self): return u"A very bad error." + +# Can take a non-string. +>>> print ValidationError(VeryBadError()).messages +<ul class="errorlist"><li>A very bad error.</li></ul> """ |
