summaryrefslogtreecommitdiff
path: root/django/contrib/formtools/tests
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 /django/contrib/formtools/tests
parent227cec686e512412f613c3d14743b85445765d92 (diff)
Fixed #18042 -- Advanced deprecation warnings.
Thanks Ramiro for the patch.
Diffstat (limited to 'django/contrib/formtools/tests')
-rw-r--r--django/contrib/formtools/tests/__init__.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/django/contrib/formtools/tests/__init__.py b/django/contrib/formtools/tests/__init__.py
index e628690491..96d1dda625 100644
--- a/django/contrib/formtools/tests/__init__.py
+++ b/django/contrib/formtools/tests/__init__.py
@@ -7,6 +7,7 @@ from django.conf import settings
from django.contrib.formtools import preview, utils
from django.contrib.formtools.wizard import FormWizard
from django.test import TestCase
+from django.test.utils import get_warnings_state, restore_warnings_state
from django.test.utils import override_settings
from django.utils import unittest
@@ -40,12 +41,20 @@ class PreviewTests(TestCase):
def setUp(self):
super(PreviewTests, self).setUp()
+ self.save_warnings_state()
+ warnings.filterwarnings('ignore', category=DeprecationWarning,
+ module='django.contrib.formtools.wizard.legacy')
+
# Create a FormPreview instance to share between tests
self.preview = preview.FormPreview(TestForm)
input_template = '<input type="hidden" name="%s" value="%s" />'
self.input = input_template % (self.preview.unused_name('stage'), "%d")
self.test_data = {'field1':u'foo', 'field1_':u'asdf'}
+ def tearDown(self):
+ super(PreviewTests, self).tearDown()
+ self.restore_warnings_state()
+
def test_unused_name(self):
"""
Verifies name mangling to get uniue field name.