Kaydet (Commit) bcdbafc8 authored tarafından Russell Keith-Magee's avatar Russell Keith-Magee

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
üst 32517041
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/')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment