mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
[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 934400759d from master
This commit is contained in:
committed by
Tim Graham
parent
a752a2c951
commit
fae31f2348
@@ -237,7 +237,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')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user