mirror of
https://github.com/django/django.git
synced 2025-11-01 04:17:59 +00:00
Fixed #20439 -- Started deprecation of IPAddressField
This commit is contained in:
parent
8f51ba669a
commit
1a63092981
14 changed files with 68 additions and 12 deletions
|
|
@ -3,6 +3,7 @@ from __future__ import unicode_literals
|
|||
import datetime
|
||||
from decimal import Decimal
|
||||
import unittest
|
||||
import warnings
|
||||
|
||||
from django import test
|
||||
from django import forms
|
||||
|
|
@ -603,9 +604,11 @@ class PromiseTest(test.TestCase):
|
|||
|
||||
def test_IPAddressField(self):
|
||||
lazy_func = lazy(lambda: '127.0.0.1', six.text_type)
|
||||
self.assertIsInstance(
|
||||
IPAddressField().get_prep_value(lazy_func()),
|
||||
six.text_type)
|
||||
with warnings.catch_warnings(record=True) as w:
|
||||
warnings.simplefilter("always")
|
||||
self.assertIsInstance(
|
||||
IPAddressField().get_prep_value(lazy_func()),
|
||||
six.text_type)
|
||||
|
||||
def test_GenericIPAddressField(self):
|
||||
lazy_func = lazy(lambda: '127.0.0.1', six.text_type)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue