mirror of
https://github.com/django/django.git
synced 2026-02-09 02:49:25 +08:00
Closed temporary files in OverwritingStorageTests.test_save_overwrite_behavior_temp_file().
This commit is contained in:
@@ -671,9 +671,11 @@ class OverwritingStorageTests(FileStorageTests):
|
||||
content_1 = b"content one"
|
||||
content_2 = b"second content"
|
||||
f_1 = TemporaryUploadedFile("tmp1", "text/plain", 11, "utf8")
|
||||
self.addCleanup(f_1.close)
|
||||
f_1.write(content_1)
|
||||
f_1.seek(0)
|
||||
f_2 = TemporaryUploadedFile("tmp2", "text/plain", 14, "utf8")
|
||||
self.addCleanup(f_2.close)
|
||||
f_2.write(content_2)
|
||||
f_2.seek(0)
|
||||
stored_name_1 = self.storage.save(name, f_1)
|
||||
|
||||
Reference in New Issue
Block a user