mirror of
				https://github.com/django/django.git
				synced 2025-10-26 07:06:08 +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',
 | |
|             )],
 | |
|         )
 |