Ticket #8175: 8175.charmless.diff
File 8175.charmless.diff, 1.1 KB (added by , 16 years ago) |
---|
-
django/db/models/fields/files.py
80 80 save.alters_data = True 81 81 82 82 def delete(self, save=True): 83 self.close() 83 if hasattr(self, '_file'): 84 self.close() 85 del self._file 84 86 self.storage.delete(self.name) 85 87 86 88 self._name = None -
tests/regressiontests/file_storage/models.py
40 40 >>> p.mug_width 41 41 16 42 42 43 # delete when file exists: 44 >>> p.delete() 45 46 # delete when file has been removed 47 >>> image_data = open(os.path.join(os.path.dirname(__file__), "test.png"), 'rb').read() 48 >>> p = Person(name="Joe") 49 >>> p.mugshot.save("mug", ContentFile(image_data)) 50 >>> import os 51 >>> os.remove(p.mugshot.path) 52 >>> p.delete() 53 43 54 """} 44 45 No newline at end of file 55