mirror of
https://github.com/django/django.git
synced 2025-12-04 00:55:36 +00:00
Refs #23947 -- Worked around a bug in Python that prevents deprecation warnings from appearing in tests.
This commit is contained in:
parent
1917017b8d
commit
9f427617e4
3 changed files with 18 additions and 0 deletions
|
|
@ -5,6 +5,7 @@ from unittest import skipUnless
|
|||
import warnings
|
||||
|
||||
from django.test import SimpleTestCase
|
||||
from django.test.utils import reset_warning_registry
|
||||
from django.utils import six, text
|
||||
from django.utils.deprecation import RemovedInDjango19Warning
|
||||
from django.utils.encoding import force_text
|
||||
|
|
@ -219,6 +220,7 @@ class TestUtilsText(SimpleTestCase):
|
|||
self.assertEqual(text.javascript_quote(input), output)
|
||||
|
||||
def test_deprecation(self):
|
||||
reset_warning_registry()
|
||||
with warnings.catch_warnings(record=True) as w:
|
||||
warnings.simplefilter("always")
|
||||
text.javascript_quote('thingy')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue