Fixed #6456 - Excised FileField file deletion to avoid data loss. Thanks to durdinator for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15321 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Carl Meyer 2011-01-26 07:46:19 +00:00
parent 80287f1e8a
commit 00e7a571c5
3 changed files with 16 additions and 16 deletions

View file

@ -61,11 +61,10 @@ class FileTests(TestCase):
cache.set("obj2", obj2)
self.assertEqual(cache.get("obj2").normal.name, "tests/django_test_1.txt")
# Deleting an object deletes the file it uses, if there are no other
# objects still using that file.
# Deleting an object does not delete the file it uses.
obj2.delete()
obj2.normal.save("django_test.txt", ContentFile("more content"))
self.assertEqual(obj2.normal.name, "tests/django_test_1.txt")
self.assertEqual(obj2.normal.name, "tests/django_test_2.txt")
# Multiple files with the same name get _N appended to them.
objs = [Storage() for i in range(3)]