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:
Tim Graham 2016-06-17 21:04:02 -04:00
parent 91e9be45ed
commit 7def55c3f6
2 changed files with 4 additions and 13 deletions

View file

@ -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)]