mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #20439 -- Started deprecation of IPAddressField
This commit is contained in:
committed by
Aymeric Augustin
parent
8f51ba669a
commit
1a63092981
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user