From c179ad9fe7e82dcb80261aa016f2fe18c8fcc181 Mon Sep 17 00:00:00 2001 From: Francesco Panico Date: Fri, 30 Dec 2022 12:47:59 +0100 Subject: Refs #34100 -- Made file upload tests use Storage.exists() where appropriate. --- tests/model_fields/test_filefield.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tests/model_fields') diff --git a/tests/model_fields/test_filefield.py b/tests/model_fields/test_filefield.py index e7c906112d..2259c1e480 100644 --- a/tests/model_fields/test_filefield.py +++ b/tests/model_fields/test_filefield.py @@ -120,9 +120,12 @@ class FileFieldTests(TestCase): with TemporaryUploadedFile( "foo.txt", "text/plain", 1, "utf-8" ) as tmp_file: - Document.objects.create(myfile=tmp_file) - self.assertTrue( - os.path.exists(os.path.join(tmp_dir, "unused", "foo.txt")) + document = Document.objects.create(myfile=tmp_file) + self.assertIs( + document.myfile.storage.exists( + os.path.join("unused", "foo.txt") + ), + True, ) def test_pickle(self): -- cgit v1.3