summaryrefslogtreecommitdiff
path: root/tests/admin_scripts
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_scripts
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_scripts')
-rw-r--r--tests/admin_scripts/tests.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py
index 90f6cc077f..ed0958af3f 100644
--- a/tests/admin_scripts/tests.py
+++ b/tests/admin_scripts/tests.py
@@ -13,6 +13,7 @@ import shutil
import socket
import subprocess
import sys
+import tempfile
import unittest
import django
@@ -31,7 +32,7 @@ from django.utils.deprecation import RemovedInDjango19Warning
from django.utils.encoding import force_text
from django.utils.six import StringIO
-test_dir = os.path.realpath(os.path.join(os.environ['DJANGO_TEST_TEMP_DIR'], 'test_project'))
+test_dir = os.path.realpath(os.path.join(tempfile.gettempdir(), 'test_project'))
if not os.path.exists(test_dir):
os.mkdir(test_dir)
open(os.path.join(test_dir, '__init__.py'), 'w').close()