summaryrefslogtreecommitdiff
path: root/tests/file_storage
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2015-02-21 18:56:36 +0100
committerTim Graham <timograham@gmail.com>2015-02-23 15:26:26 -0500
commitfae31f234823474cd2b81efba56fa714cc34d9cd (patch)
tree576adbdb168f78a3615a71dbab9a3a4da906f898 /tests/file_storage
parenta752a2c951d1836a8f58452b499974ff3742ee16 (diff)
[1.8.x] Guaranteed removal of temporary files during tests.
Dropped the DJANGO_TEST_TEMP_DIR environment variable. Before this change, proper removal depended on the developer passing dir=os.environ['DJANGO_TEST_TMP_DIR'] to tempfile functions. Backport of 934400759de817471ff37d736686201d7ae34e82 from master
Diffstat (limited to 'tests/file_storage')
-rw-r--r--tests/file_storage/models.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/file_storage/models.py b/tests/file_storage/models.py
index 45a3d9f0e7..c7523bdea4 100644
--- a/tests/file_storage/models.py
+++ b/tests/file_storage/models.py
@@ -5,7 +5,6 @@ Storing files according to a custom storage system
and where files should be stored.
"""
-import os
import random
import tempfile
@@ -26,7 +25,7 @@ class OldStyleFSStorage(FileSystemStorage):
return super(OldStyleFSStorage, self).save(name, content)
-temp_storage_location = tempfile.mkdtemp(dir=os.environ['DJANGO_TEST_TEMP_DIR'])
+temp_storage_location = tempfile.mkdtemp()
temp_storage = FileSystemStorage(location=temp_storage_location)