summaryrefslogtreecommitdiff
path: root/tests/model_fields
diff options
context:
space:
mode:
authorFrancesco Panico <panico.francesco@gmail.com>2022-12-30 12:47:59 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-12-30 13:28:47 +0100
commitc179ad9fe7e82dcb80261aa016f2fe18c8fcc181 (patch)
treea8b2b0faa53ee7e84fe1d7aacd3bbd3dec147bb3 /tests/model_fields
parent6e9e7ec472bdc870152e1f4f4130ecc07cdfc820 (diff)
downloaddjango-c179ad9fe7e82dcb80261aa016f2fe18c8fcc181.tar.gz
Refs #34100 -- Made file upload tests use Storage.exists() where appropriate.
Diffstat (limited to 'tests/model_fields')
-rw-r--r--tests/model_fields/test_filefield.py9
1 files changed, 6 insertions, 3 deletions
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):