mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Refs #31369 -- Deprecated models.NullBooleanField in favor of BooleanField(null=True).
This commit is contained in:
committed by
Mariusz Felisiak
parent
34a69c2458
commit
a92cc84b4a
@@ -37,3 +37,18 @@ class DeprecatedFieldsTests(SimpleTestCase):
|
||||
id='fields.E901',
|
||||
)],
|
||||
)
|
||||
|
||||
def test_nullbooleanfield_deprecated(self):
|
||||
class NullBooleanFieldModel(models.Model):
|
||||
nb = models.NullBooleanField()
|
||||
|
||||
model = NullBooleanFieldModel()
|
||||
self.assertEqual(model.check(), [
|
||||
checks.Warning(
|
||||
'NullBooleanField is deprecated. Support for it (except in '
|
||||
'historical migrations) will be removed in Django 4.0.',
|
||||
hint='Use BooleanField(null=True) instead.',
|
||||
obj=NullBooleanFieldModel._meta.get_field('nb'),
|
||||
id='fields.W903',
|
||||
),
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user