diff options
| author | Tim Graham <timograham@gmail.com> | 2016-12-19 18:47:30 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-12-20 07:57:25 -0500 |
| commit | e8d8fb3295ee6d34fc8430fbf264b997335db390 (patch) | |
| tree | 57f5cd282a2472ec8617d44229fb40e2c5c56e3a /tests/model_fields | |
| parent | 09a7f121b51b7245470d6d6d3181695953208864 (diff) | |
Added a test for NullBooleanField.formfield().
Diffstat (limited to 'tests/model_fields')
| -rw-r--r-- | tests/model_fields/test_booleanfield.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/model_fields/test_booleanfield.py b/tests/model_fields/test_booleanfield.py index f61be4e28a..f295f24980 100644 --- a/tests/model_fields/test_booleanfield.py +++ b/tests/model_fields/test_booleanfield.py @@ -1,3 +1,4 @@ +from django import forms from django.core.exceptions import ValidationError from django.db import IntegrityError, models, transaction from django.test import SimpleTestCase, TestCase @@ -40,6 +41,10 @@ class BooleanFieldTests(TestCase): f = models.BooleanField(choices=choices, default=1, null=False) self.assertEqual(f.formfield().choices, choices) + def test_nullbooleanfield_formfield(self): + f = models.NullBooleanField() + self.assertIsInstance(f.formfield(), forms.NullBooleanField) + def test_return_type(self): b = BooleanModel.objects.create(bfield=True) b.refresh_from_db() |
