Silenced DeprecationWarning raised by tests for populate_xheaders tests. Refs #15741

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15998 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2011-04-02 13:26:54 +00:00
parent 32517041bd
commit bcdbafc88a
1 changed files with 11 additions and 1 deletions

View File

@ -1,13 +1,23 @@
import warnings
from django.test import TestCase
from django.contrib.auth.models import User
class SpecialHeadersTest(TestCase):
fixtures = ['data.xml']
def setUp(self):
self.save_warnings_state()
warnings.filterwarnings('ignore', category=DeprecationWarning,
module='django.views.generic.list_detail')
def tearDown(self):
self.restore_warnings_state()
def test_xheaders(self):
user = User.objects.get(username='super')
response = self.client.get('/special_headers/article/1/')
# import pdb; pdb.set_trace()
self.assertFalse('X-Object-Type' in response)
self.client.login(username='super', password='secret')
response = self.client.get('/special_headers/article/1/')