summaryrefslogtreecommitdiff
path: root/tests/admin_views
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/admin_views
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/admin_views')
-rw-r--r--tests/admin_views/admin.py2
-rw-r--r--tests/admin_views/models.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/admin_views/admin.py b/tests/admin_views/admin.py
index 0ed31ce0c5..d7d4be86bc 100644
--- a/tests/admin_views/admin.py
+++ b/tests/admin_views/admin.py
@@ -310,7 +310,7 @@ class OldSubscriberAdmin(admin.ModelAdmin):
actions = None
-temp_storage = FileSystemStorage(tempfile.mkdtemp(dir=os.environ['DJANGO_TEST_TEMP_DIR']))
+temp_storage = FileSystemStorage(tempfile.mkdtemp())
UPLOAD_TO = os.path.join(temp_storage.location, 'test_upload')
diff --git a/tests/admin_views/models.py b/tests/admin_views/models.py
index c4d247d56c..07f6864cf5 100644
--- a/tests/admin_views/models.py
+++ b/tests/admin_views/models.py
@@ -316,7 +316,7 @@ class EmptyModel(models.Model):
return "Primary key = %s" % self.id
-temp_storage = FileSystemStorage(tempfile.mkdtemp(dir=os.environ['DJANGO_TEST_TEMP_DIR']))
+temp_storage = FileSystemStorage(tempfile.mkdtemp())
UPLOAD_TO = os.path.join(temp_storage.location, 'test_upload')