From fae31f234823474cd2b81efba56fa714cc34d9cd Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sat, 21 Feb 2015 18:56:36 +0100 Subject: [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 --- tests/forms_tests/models.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tests/forms_tests') diff --git a/tests/forms_tests/models.py b/tests/forms_tests/models.py index 936bf8b41f..830927aeba 100644 --- a/tests/forms_tests/models.py +++ b/tests/forms_tests/models.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals import datetime import itertools -import os import tempfile from django.core.files.storage import FileSystemStorage @@ -14,8 +13,7 @@ callable_default_counter = itertools.count() callable_default = lambda: next(callable_default_counter) -temp_storage_location = tempfile.mkdtemp(dir=os.environ['DJANGO_TEST_TEMP_DIR']) -temp_storage = FileSystemStorage(location=temp_storage_location) +temp_storage = FileSystemStorage(location=tempfile.mkdtemp()) class BoundaryModel(models.Model): -- cgit v1.3