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
-
This field is required.
-
-
This field is required.
-
-
This field is required.
-
+
This field is required.
+
This field is required.
+
This field is required.
>>> print p.as_table()
-
This field is required.
-
-
This field is required.
-
-
This field is required.
-
+
This field is required.
+
This field is required.
+
This field is required.
>>> print p.as_ul()
This field is required.
This field is required.
@@ -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()
-
This field is required.
-
Username:
-
This field is required.
-
Password1:
-
This field is required.
-
Password2:
+
Username:
This field is required.
+
Password1:
This field is required.
+
Password2:
This field is required.
>>> 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).