Ticket #8222: 8222.storage.save.diff

File 8222.storage.save.diff, 1.2 KB (added by Julien Phalip, 16 years ago)

Same patch, but changed the word 'rewind'

  • django/django/core/files/storage.py

     
    4343        name = self.get_available_name(name)
    4444        name = self._save(name, content)
    4545
     46        content.seek(0)
     47
    4648        # Store filenames with forward slashes, even on Windows
    4749        return force_unicode(name.replace('\\', '/'))
    4850
  • django/tests/regressiontests/file_storage/tests.py

     
    6363
    6464>>> custom_storage.delete(first)
    6565>>> 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)
    6675"""
    6776
    6877# Tests for a race condition on file saving (#4948).
Back to Top