1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +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:
Aymeric Augustin
2015-02-21 18:56:36 +01:00
committed by Tim Graham
parent a752a2c951
commit fae31f2348
11 changed files with 21 additions and 20 deletions

View File

@@ -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)