mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Reverted "Fixed #26398 -- Made FieldFile.open() respect its mode argument."
This reverts commit a52a531a8b due to
regressions described in refs #26772.
This commit is contained in:
@@ -734,16 +734,6 @@ class FileFieldStorageTests(TestCase):
|
||||
self.assertEqual(list(obj.normal.chunks(chunk_size=2)), [b"co", b"nt", b"en", b"t"])
|
||||
obj.normal.close()
|
||||
|
||||
def test_filefield_write(self):
|
||||
# Files can be written to.
|
||||
obj = Storage.objects.create(normal=SimpleUploadedFile('rewritten.txt', b'content'))
|
||||
with obj.normal as normal:
|
||||
normal.open('wb')
|
||||
normal.write(b'updated')
|
||||
obj.refresh_from_db()
|
||||
self.assertEqual(obj.normal.read(), b'updated')
|
||||
obj.normal.close()
|
||||
|
||||
def test_duplicate_filename(self):
|
||||
# Multiple files with the same name get _(7 random chars) appended to them.
|
||||
objs = [Storage() for i in range(2)]
|
||||
|
||||
Reference in New Issue
Block a user