summaryrefslogtreecommitdiff
path: root/tests/model_fields
diff options
context:
space:
mode:
Diffstat (limited to 'tests/model_fields')
-rw-r--r--tests/model_fields/tests.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/model_fields/tests.py b/tests/model_fields/tests.py
index 76b3e5596a..fc197cf0c4 100644
--- a/tests/model_fields/tests.py
+++ b/tests/model_fields/tests.py
@@ -54,6 +54,12 @@ class BasicFieldTests(TestCase):
klass = forms.TypedMultipleChoiceField
self.assertIsInstance(field.formfield(choices_form_class=klass), klass)
+ def test_formfield_disabled(self):
+ """Field.formfield() sets disabled for fields with choices."""
+ field = models.CharField(choices=[('a', 'b')])
+ form_field = field.formfield(disabled=True)
+ self.assertIs(form_field.disabled, True)
+
def test_field_str(self):
f = models.Field()
self.assertEqual(str(f), '<django.db.models.fields.Field>')