summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2008-08-27 21:18:45 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2008-08-27 21:18:45 +0000
commit8943a857a7bcf8aae9edc0eb09719e36f7b9e78c (patch)
treec0874ee9af94f35fd04cde09fa708055384bedd7 /tests
parentc33aeaa082b2f821db0b87afbd01f5e0144b9aa4 (diff)
Fixed #8175: don't open files we're about to close. This was a pesky bug to track down; thanks to charmless for tracking it down.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8637 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/file_storage/models.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/regressiontests/file_storage/models.py b/tests/regressiontests/file_storage/models.py
index df99045352..c0557bcab4 100644
--- a/tests/regressiontests/file_storage/models.py
+++ b/tests/regressiontests/file_storage/models.py
@@ -40,5 +40,11 @@ if Image:
>>> p.mug_width
16
+# Bug #8175: correctly delete files that have been removed off the file system.
+>>> import os
+>>> p2 = Person(name="Fred")
+>>> p2.mugshot.save("shot", ContentFile(image_data))
+>>> os.remove(p2.mugshot.path)
+>>> p2.delete()
"""}
\ No newline at end of file