summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/model_fields/test_booleanfield.py5
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()