diff --git a/django/newforms/widgets.py b/django/newforms/widgets.py
index 8d292673a5..f701faa35d 100644
--- a/django/newforms/widgets.py
+++ b/django/newforms/widgets.py
@@ -121,6 +121,12 @@ class FileInput(Input):
input_type = 'file'
class Textarea(Widget):
+ def __init__(self, attrs=None):
+ # The 'rows' and 'cols' attributes are required for HTML correctness.
+ self.attrs = {'cols': '40', 'rows': '10'}
+ if attrs:
+ self.attrs.update(attrs)
+
def render(self, name, value, attrs=None):
if value is None: value = ''
value = smart_unicode(value)
diff --git a/tests/modeltests/model_forms/models.py b/tests/modeltests/model_forms/models.py
index d91f1d2d45..2757787571 100644
--- a/tests/modeltests/model_forms/models.py
+++ b/tests/modeltests/model_forms/models.py
@@ -159,7 +159,7 @@ represented by a ChoiceField.
-
Article: | |
+Article: | |
Categories: |
-Article:
+Article:
Categories:
-Article:
+Article:
Categories:
-Article:
+Article:
Categories:
-Article:
+Article:
Categories: |
---|