mirror of
https://github.com/django/django.git
synced 2024-12-23 09:36:06 +00:00
23 lines
695 B
Python
23 lines
695 B
Python
|
from django.core import checks
|
||
|
from django.db import models
|
||
|
|
||
|
from .base import IsolatedModelsTestCase
|
||
|
|
||
|
|
||
|
class DeprecatedFieldssTests(IsolatedModelsTestCase):
|
||
|
def test_IPAddressField_deprecated(self):
|
||
|
class IPAddressModel(models.Model):
|
||
|
ip = models.IPAddressField()
|
||
|
|
||
|
model = IPAddressModel()
|
||
|
self.assertEqual(
|
||
|
model.check(),
|
||
|
[checks.Error(
|
||
|
'IPAddressField has been removed except for support in '
|
||
|
'historical migrations.',
|
||
|
hint='Use GenericIPAddressField instead.',
|
||
|
obj=IPAddressModel._meta.get_field('ip'),
|
||
|
id='fields.E900',
|
||
|
)],
|
||
|
)
|