mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
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:
parent
80287f1e8a
commit
00e7a571c5
3 changed files with 16 additions and 16 deletions
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue