mirror of
https://github.com/django/django.git
synced 2024-12-23 09:36:06 +00:00
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:
parent
32517041bd
commit
bcdbafc88a
@ -1,13 +1,23 @@
|
|||||||
|
import warnings
|
||||||
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
|
|
||||||
|
|
||||||
class SpecialHeadersTest(TestCase):
|
class SpecialHeadersTest(TestCase):
|
||||||
fixtures = ['data.xml']
|
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):
|
def test_xheaders(self):
|
||||||
user = User.objects.get(username='super')
|
user = User.objects.get(username='super')
|
||||||
response = self.client.get('/special_headers/article/1/')
|
response = self.client.get('/special_headers/article/1/')
|
||||||
# import pdb; pdb.set_trace()
|
|
||||||
self.assertFalse('X-Object-Type' in response)
|
self.assertFalse('X-Object-Type' in response)
|
||||||
self.client.login(username='super', password='secret')
|
self.client.login(username='super', password='secret')
|
||||||
response = self.client.get('/special_headers/article/1/')
|
response = self.client.get('/special_headers/article/1/')
|
||||||
|
Loading…
Reference in New Issue
Block a user