summaryrefslogtreecommitdiff
path: root/tests/model_fields
diff options
context:
space:
mode:
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):