Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#15224 closed (wontfix)

FileField object doesn't deletes the associated files

Reported by: Rohan Jain <m@…> Owned by: Rohan Jain
Component: File uploads/storage Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When an object of Model with FileField is deleted, the files associated with it persist in the filesystem. An issue due to this on my project: https://github.com/dcrodjer/codesport/issues/#issue/1

Change History (4)

comment:1 by Łukasz Rekucki, 14 years ago

Resolution: wontfix
Status: newclosed

This has been recently changed, to explicitly not delete the files: http://code.djangoproject.com/ticket/6456; So I'm marking it as "won't fix".

Version 0, edited 14 years ago by Łukasz Rekucki (next)

comment:2 by Rohan Jain <m@…>, 14 years ago

Just saw this older ticket: http://code.djangoproject.com/ticket/6456, it says that this was done intentionally.
So how can someone deal with tests which involve file fields. One can't let the tests create so many files in the directory on each test run.

in reply to:  2 comment:3 by Łukasz Rekucki, 14 years ago

Replying to Rohan Jain <m@…>:

Just saw this older ticket: http://code.djangoproject.com/ticket/6456, it says that this was done intentionally.
So how can someone deal with tests which involve file fields. One can't let the tests create so many files in the directory on each test run.

You can create a temporary directory during setUp of your test case and make sure your storage backend uses it to save files, then delete the directory in tearDown. If you need more details, feel free to ask on django-users.

comment:4 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

Note: See TracTickets for help on using tickets.
Back to Top