Fix catch_warnings for Python 3

This commit is contained in:
David Avsajanishvili 2013-06-04 13:42:31 +04:00
parent ae9ec60ce6
commit 74643b08b6

View File

@ -94,7 +94,7 @@ class ClassBasedViewIntegrationTests(TestCase):
def test_return_400_error(self):
request = factory.post('/', '{"return_400_error": true}',
content_type='application/json')
with warnings.catch_warnings(True) as w:
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter('always')
response = self.view(request)
self.assertEqual(len(w), 1)
@ -146,7 +146,7 @@ class FunctionBasedViewIntegrationTests(TestCase):
def test_return_400_error(self):
request = factory.post('/', '{"return_400_error": true}',
content_type='application/json')
with warnings.catch_warnings(True) as w:
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter('always')
response = self.view(request)
self.assertEqual(len(w), 1)