mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #18042 -- Advanced deprecation warnings.
Thanks Ramiro for the patch.
This commit is contained in:
parent
227cec686e
commit
e84f79f051
27 changed files with 75 additions and 38 deletions
|
@ -1,9 +1,19 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import unittest
|
||||
import warnings
|
||||
|
||||
from django.test import SimpleTestCase
|
||||
from django.utils import text
|
||||
|
||||
class TestUtilsText(unittest.TestCase):
|
||||
class TestUtilsText(SimpleTestCase):
|
||||
|
||||
# In Django 1.6 truncate_words() and truncate_html_words() will be removed
|
||||
# so these tests will need to be adapted accordingly
|
||||
def setUp(self):
|
||||
self.save_warnings_state()
|
||||
warnings.filterwarnings('ignore', category=DeprecationWarning, module='django.utils.text')
|
||||
|
||||
def tearDown(self):
|
||||
self.restore_warnings_state()
|
||||
|
||||
def test_truncate_chars(self):
|
||||
truncator = text.Truncator(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue