From 00e7a571c5737c69bc225ae39d3dca6d0fbfd072 Mon Sep 17 00:00:00 2001 From: Carl Meyer Date: Wed, 26 Jan 2011 07:46:19 +0000 Subject: 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 --- tests/modeltests/files/tests.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/modeltests/files/tests.py b/tests/modeltests/files/tests.py index 26808f7d9a..ad5c3a7cc3 100644 --- a/tests/modeltests/files/tests.py +++ b/tests/modeltests/files/tests.py @@ -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)] -- cgit v1.3