summaryrefslogtreecommitdiff
path: root/tests/string_lookup
diff options
context:
space:
mode:
authorErik Romijn <erik@erik.io>2013-09-28 10:22:46 +0200
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-09-28 10:55:32 +0200
commit1a63092981c685214ea189a14007da7bcc823c17 (patch)
treee3609a8b97656b2eae4ebc668bfb152d0483fc54 /tests/string_lookup
parent8f51ba669aba94eea684ea3f3429fd8e39e70679 (diff)
Fixed #20439 -- Started deprecation of IPAddressField
Diffstat (limited to 'tests/string_lookup')
-rw-r--r--tests/string_lookup/models.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/string_lookup/models.py b/tests/string_lookup/models.py
index a2d64cd0b2..43ed90a462 100644
--- a/tests/string_lookup/models.py
+++ b/tests/string_lookup/models.py
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
+import warnings
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@@ -49,7 +50,9 @@ class Base(models.Model):
class Article(models.Model):
name = models.CharField(max_length=50)
text = models.TextField()
- submitted_from = models.IPAddressField(blank=True, null=True)
+ with warnings.catch_warnings(record=True) as w:
+ warnings.simplefilter("always")
+ submitted_from = models.IPAddressField(blank=True, null=True)
def __str__(self):
return "Article %s" % self.name