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.
This commit is contained in:
Aymeric Augustin 2015-02-21 18:56:36 +01:00 committed by Aymeric Augustin
parent e83aba0e2c
commit 934400759d
11 changed files with 21 additions and 20 deletions

View file

@ -236,7 +236,7 @@ if Image:
attr_class = TestImageFieldFile
# Set up a temp directory for file storage.
temp_storage_dir = tempfile.mkdtemp(dir=os.environ['DJANGO_TEST_TEMP_DIR'])
temp_storage_dir = tempfile.mkdtemp()
temp_storage = FileSystemStorage(temp_storage_dir)
temp_upload_to_dir = os.path.join(temp_storage.location, 'tests')