mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Refs #34100 -- Made file upload tests use Storage.exists() where appropriate.
This commit is contained in:
committed by
Mariusz Felisiak
parent
6e9e7ec472
commit
c179ad9fe7
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user