mirror of https://github.com/django/django.git
Fixed #33518 -- Added RemovedAfterNextVersionWarning.
This commit is contained in:
parent
f70a875cc0
commit
e559070a7a
|
@ -13,6 +13,9 @@ class RemovedInDjango50Warning(PendingDeprecationWarning):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
RemovedAfterNextVersionWarning = RemovedInDjango50Warning
|
||||||
|
|
||||||
|
|
||||||
class warn_about_renamed_method:
|
class warn_about_renamed_method:
|
||||||
def __init__(
|
def __init__(
|
||||||
self, class_name, old_method_name, new_method_name, deprecation_warning
|
self, class_name, old_method_name, new_method_name, deprecation_warning
|
||||||
|
|
|
@ -3,6 +3,7 @@ import warnings
|
||||||
from django.test import SimpleTestCase
|
from django.test import SimpleTestCase
|
||||||
from django.utils.deprecation import (
|
from django.utils.deprecation import (
|
||||||
DeprecationInstanceCheck,
|
DeprecationInstanceCheck,
|
||||||
|
RemovedAfterNextVersionWarning,
|
||||||
RemovedInNextVersionWarning,
|
RemovedInNextVersionWarning,
|
||||||
RenameMethodsBase,
|
RenameMethodsBase,
|
||||||
)
|
)
|
||||||
|
@ -161,6 +162,11 @@ class RenameMethodsTests(SimpleTestCase):
|
||||||
with self.assertWarnsMessage(DeprecationWarning, msg):
|
with self.assertWarnsMessage(DeprecationWarning, msg):
|
||||||
deprecated.old()
|
deprecated.old()
|
||||||
|
|
||||||
|
def test_removedafternextversionwarning_pending(self):
|
||||||
|
self.assertTrue(
|
||||||
|
issubclass(RemovedAfterNextVersionWarning, PendingDeprecationWarning)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class DeprecationInstanceCheckTest(SimpleTestCase):
|
class DeprecationInstanceCheckTest(SimpleTestCase):
|
||||||
def test_warning(self):
|
def test_warning(self):
|
||||||
|
|
Loading…
Reference in New Issue