Ticket #8222: 8222.storage.save.diff
File 8222.storage.save.diff, 1.2 KB (added by , 16 years ago) |
---|
-
django/django/core/files/storage.py
43 43 name = self.get_available_name(name) 44 44 name = self._save(name, content) 45 45 46 content.seek(0) 47 46 48 # Store filenames with forward slashes, even on Windows 47 49 return force_unicode(name.replace('\\', '/')) 48 50 -
django/tests/regressiontests/file_storage/tests.py
63 63 64 64 >>> custom_storage.delete(first) 65 65 >>> custom_storage.delete(second) 66 67 # File's cursor should be reset to start of file 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 """ 67 76 68 77 # Tests for a race condition on file saving (#4948).