mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
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:
parent
70ec4d776e
commit
210d0489c5
84 changed files with 287 additions and 189 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue