mirror of
https://github.com/django/django.git
synced 2025-03-31 19:46:42 +00:00
Refs #27184 -- Fixed unclosed file ResourceWarning in test_client test.
This commit is contained in:
parent
7a4e2fc5a2
commit
8db6a6c0a1
@ -717,8 +717,8 @@ class ClientTest(TestCase):
|
|||||||
self.client.get('/nesting_exception_view/')
|
self.client.get('/nesting_exception_view/')
|
||||||
|
|
||||||
def test_uploading_temp_file(self):
|
def test_uploading_temp_file(self):
|
||||||
test_file = tempfile.TemporaryFile()
|
with tempfile.TemporaryFile() as test_file:
|
||||||
response = self.client.post('/upload_view/', data={'temp_file': test_file})
|
response = self.client.post('/upload_view/', data={'temp_file': test_file})
|
||||||
self.assertEqual(response.content, b'temp_file')
|
self.assertEqual(response.content, b'temp_file')
|
||||||
|
|
||||||
def test_uploading_named_temp_file(self):
|
def test_uploading_named_temp_file(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user