summaryrefslogtreecommitdiff
path: root/tests/regressiontests/utils/text.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@polyconseil.fr>2012-05-03 15:27:01 +0200
committerAymeric Augustin <aymeric.augustin@polyconseil.fr>2012-05-03 15:27:01 +0200
commite84f79f05113f546810c1908c7baef99fb1e874a (patch)
tree4cb5f3e428caa894bd9acc06fc3cd6250b018715 /tests/regressiontests/utils/text.py
parent227cec686e512412f613c3d14743b85445765d92 (diff)
Fixed #18042 -- Advanced deprecation warnings.
Thanks Ramiro for the patch.
Diffstat (limited to 'tests/regressiontests/utils/text.py')
-rw-r--r--tests/regressiontests/utils/text.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/regressiontests/utils/text.py b/tests/regressiontests/utils/text.py
index aae75339bc..bce7f99264 100644
--- a/tests/regressiontests/utils/text.py
+++ b/tests/regressiontests/utils/text.py
@@ -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(