Ticket #8222: 8222.file.storage.rewind.diff
File 8222.file.storage.rewind.diff, 1.1 KB (added by , 16 years ago) |
---|
-
django/django/core/files/storage.py
43 43 44 44 self._save(name, content) 45 45 46 # Rewind file to initial position 47 content.seek(0) 48 46 49 # Store filenames with forward slashes, even on Windows 47 50 return force_unicode(name.replace('\\', '/')) 48 51 -
django/tests/regressiontests/file_storage/tests.py
63 63 64 64 >>> custom_storage.delete(first) 65 65 >>> custom_storage.delete(second) 66 67 # Files should be rewinded to initial position after saving. 68 69 >>> temp_file = ContentFile('some contents') 70 >>> temp_name = temp_storage.save('temp_file.txt', temp_file) 71 >>> temp_file.read() 72 'some contents' 73 74 >>> temp_storage.delete(temp_name) 66 75 """