summaryrefslogtreecommitdiff
path: root/tests/forms_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/forms_tests')
-rw-r--r--tests/forms_tests/tests/test_fields.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/forms_tests/tests/test_fields.py b/tests/forms_tests/tests/test_fields.py
index 8cea26c37c..5a42e4b95d 100644
--- a/tests/forms_tests/tests/test_fields.py
+++ b/tests/forms_tests/tests/test_fields.py
@@ -38,7 +38,7 @@ from django.forms import (
DecimalField, EmailField, Field, FileField, FilePathField, FloatField,
Form, forms, HiddenInput, IntegerField, MultipleChoiceField,
NullBooleanField, NumberInput, PasswordInput, RadioSelect, RegexField,
- SplitDateTimeField, TextInput, TimeField, TypedChoiceField,
+ SplitDateTimeField, TextInput, Textarea, TimeField, TypedChoiceField,
TypedMultipleChoiceField, URLField, ValidationError, Widget,
)
from django.test import SimpleTestCase
@@ -148,14 +148,13 @@ class FieldsTests(SimpleTestCase):
# Return an empty dictionary if max_length is None
f = CharField()
self.assertEqual(f.widget_attrs(TextInput()), {})
-
- # Or if the widget is not TextInput or PasswordInput
- f = CharField(max_length=10)
- self.assertEqual(f.widget_attrs(HiddenInput()), {})
+ self.assertEqual(f.widget_attrs(Textarea()), {})
# Otherwise, return a maxlength attribute equal to max_length
+ f = CharField(max_length=10)
self.assertEqual(f.widget_attrs(TextInput()), {'maxlength': '10'})
self.assertEqual(f.widget_attrs(PasswordInput()), {'maxlength': '10'})
+ self.assertEqual(f.widget_attrs(Textarea()), {'maxlength': '10'})
# IntegerField ################################################################