1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #20439 -- Started deprecation of IPAddressField

This commit is contained in:
Erik Romijn
2013-09-28 10:22:46 +02:00
committed by Aymeric Augustin
parent 8f51ba669a
commit 1a63092981
14 changed files with 68 additions and 12 deletions

View File

@@ -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)