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.
This commit is contained in:
Claude Paroz 2014-02-26 22:48:20 +01:00
parent 70ec4d776e
commit 210d0489c5
84 changed files with 287 additions and 189 deletions

View file

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