summaryrefslogtreecommitdiff
path: root/tests/model_forms
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2014-02-26 22:48:20 +0100
committerClaude Paroz <claude@2xlibre.net>2014-03-08 09:57:40 +0100
commit210d0489c5daad56b806f8165f9fe09fb3c2a019 (patch)
treef16c665e94669288fec0c3712a5639e9ad1ad1a7 /tests/model_forms
parent70ec4d776ef0e68960ccee21476b8654e9399f53 (diff)
downloaddjango-210d0489c5daad56b806f8165f9fe09fb3c2a019.tar.gz
Fixed #21188 -- Introduced subclasses for to-be-removed-in-django-XX warnings
Thanks Anssi Kääriäinen for the idea and Simon Charette for the review.
Diffstat (limited to 'tests/model_forms')
-rw-r--r--tests/model_forms/tests.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/model_forms/tests.py b/tests/model_forms/tests.py
index c75921c6e3..e651ddae7d 100644
--- a/tests/model_forms/tests.py
+++ b/tests/model_forms/tests.py
@@ -13,8 +13,9 @@ from django.core.validators import ValidationError
from django.db import connection
from django.db.models.query import EmptyQuerySet
from django.forms.models import model_to_dict
-from django.utils._os import upath
from django.test import TestCase, skipUnlessDBFeature
+from django.utils.deprecation import RemovedInDjango18Warning
+from django.utils._os import upath
from django.utils import six
from .models import (Article, ArticleStatus, BetterWriter, BigInt, Book,
@@ -265,7 +266,7 @@ class ModelFormBaseTest(TestCase):
def test_missing_fields_attribute(self):
with warnings.catch_warnings(record=True):
- warnings.simplefilter("always", DeprecationWarning)
+ warnings.simplefilter("always", RemovedInDjango18Warning)
class MissingFieldsForm(forms.ModelForm):
class Meta:
@@ -275,7 +276,7 @@ class ModelFormBaseTest(TestCase):
# if a warning has been seen already, the catch_warnings won't
# have recorded it. The following line therefore will not work reliably:
- # self.assertEqual(w[0].category, DeprecationWarning)
+ # self.assertEqual(w[0].category, RemovedInDjango18Warning)
# Until end of the deprecation cycle, should still create the
# form as before: