Closed temporary files in OverwritingStorageTests.test_save_overwrite_behavior_temp_file().

This commit is contained in:
Jacob Walls
2025-11-26 07:17:39 -05:00
parent e4c4a178aa
commit a08f1693f3

View File

@@ -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)