diff --git a/django/newforms/forms.py b/django/newforms/forms.py index 58d23e49e0..95d81062f0 100644 --- a/django/newforms/forms.py +++ b/django/newforms/forms.py @@ -114,7 +114,7 @@ class BaseForm(StrAndUnicode): def as_table(self): "Returns this form rendered as HTML s -- excluding the
." - return self._html_output(u'%(label)s%(field)s', u'%s', '', True) + return self._html_output(u'%(label)s%(errors)s%(field)s', u'%s', '', False) def as_ul(self): "Returns this form rendered as HTML
  • s -- excluding the ." diff --git a/tests/regressiontests/forms/tests.py b/tests/regressiontests/forms/tests.py index 6bf64422fb..0290ed3533 100644 --- a/tests/regressiontests/forms/tests.py +++ b/tests/regressiontests/forms/tests.py @@ -1494,19 +1494,13 @@ Empty dictionaries are valid, too. >>> p.is_valid() False >>> print p - - - - - - + + + >>> print p.as_table() - - - - - - + + + >>> print p.as_ul()
  • @@ -1895,12 +1889,9 @@ Form.clean() is required to return a dictionary of all clean data. {} >>> f = UserRegistration({}, auto_id=False) >>> print f.as_table() - -Username: - -Password1: - -Password2: +Username: +Password1: +Password2: >>> f.errors {'username': [u'This field is required.'], 'password1': [u'This field is required.'], 'password2': [u'This field is required.']} >>> f = UserRegistration({'username': 'adrian', 'password1': 'foo', 'password2': 'bar'}, auto_id=False) @@ -2237,8 +2228,7 @@ Case 2: POST with erroneous data (a redisplayed form, with errors).
    - - +
    • Please make sure your passwords match.
    • Ensure this value has at most 10 characters.
    Username:
    Username:
    • Ensure this value has at most 10 characters.
    Password1:
    Password2: