Removed unneeded deprecation warning silencing in test suite.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17940 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Claude Paroz 2012-04-26 18:06:17 +00:00
parent a6b2a15348
commit 8aca3d1cc2
2 changed files with 2 additions and 16 deletions

View File

@ -48,14 +48,6 @@ def fix_os_paths(x):
class FieldsTests(SimpleTestCase): class FieldsTests(SimpleTestCase):
def setUp(self):
self.save_warnings_state()
warnings.filterwarnings('ignore', category=DeprecationWarning,
module='django.core.validators')
def tearDown(self):
self.restore_warnings_state()
def test_field_sets_widget_is_required(self): def test_field_sets_widget_is_required(self):
self.assertTrue(Field(required=True).widget.is_required) self.assertTrue(Field(required=True).widget.is_required)
self.assertFalse(Field(required=False).widget.is_required) self.assertFalse(Field(required=False).widget.is_required)

View File

@ -13,7 +13,6 @@ import time
import os import os
import sys import sys
import traceback import traceback
import warnings
from urlparse import urljoin from urlparse import urljoin
from django import template from django import template
@ -22,8 +21,8 @@ from django.core import urlresolvers
from django.template import loader from django.template import loader
from django.template.loaders import app_directories, filesystem, cached from django.template.loaders import app_directories, filesystem, cached
from django.test import RequestFactory from django.test import RequestFactory
from django.test.utils import (get_warnings_state, restore_warnings_state, from django.test.utils import (setup_test_template_loader,
setup_test_template_loader, restore_template_loaders, override_settings) restore_template_loaders, override_settings)
from django.utils import unittest from django.utils import unittest
from django.utils.formats import date_format from django.utils.formats import date_format
from django.utils.translation import activate, deactivate, ugettext as _ from django.utils.translation import activate, deactivate, ugettext as _
@ -152,10 +151,6 @@ class UTF8Class:
class Templates(unittest.TestCase): class Templates(unittest.TestCase):
def setUp(self): def setUp(self):
self._warnings_state = get_warnings_state()
warnings.filterwarnings('ignore', category=DeprecationWarning,
module='django.template.defaulttags')
self.old_static_url = settings.STATIC_URL self.old_static_url = settings.STATIC_URL
self.old_media_url = settings.MEDIA_URL self.old_media_url = settings.MEDIA_URL
settings.STATIC_URL = u"/static/" settings.STATIC_URL = u"/static/"
@ -164,7 +159,6 @@ class Templates(unittest.TestCase):
def tearDown(self): def tearDown(self):
settings.STATIC_URL = self.old_static_url settings.STATIC_URL = self.old_static_url
settings.MEDIA_URL = self.old_media_url settings.MEDIA_URL = self.old_media_url
restore_warnings_state(self._warnings_state)
def test_loaders_security(self): def test_loaders_security(self):
ad_loader = app_directories.Loader() ad_loader = app_directories.Loader()