mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-01 11:00:13 +03:00
Fix catch_warnings for Python 3
This commit is contained in:
parent
ae9ec60ce6
commit
74643b08b6
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user