summaryrefslogtreecommitdiff
path: root/tests/files
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2015-02-21 18:56:36 +0100
committerAymeric Augustin <aymeric.augustin@oscaro.com>2015-02-23 16:55:26 +0100
commit934400759de817471ff37d736686201d7ae34e82 (patch)
tree834ceac28e66f7d81350a79a7f23fdb71e6cb1f4 /tests/files
parente83aba0e2cce16cd1b32d1c172239a4e20867e95 (diff)
downloaddjango-934400759de817471ff37d736686201d7ae34e82.tar.gz
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.
Diffstat (limited to 'tests/files')
-rw-r--r--tests/files/tests.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/files/tests.py b/tests/files/tests.py
index c72d948392..2401f26c8f 100644
--- a/tests/files/tests.py
+++ b/tests/files/tests.py
@@ -241,8 +241,8 @@ class InconsistentGetImageDimensionsBug(unittest.TestCase):
class FileMoveSafeTests(unittest.TestCase):
def test_file_move_overwrite(self):
- handle_a, self.file_a = tempfile.mkstemp(dir=os.environ['DJANGO_TEST_TEMP_DIR'])
- handle_b, self.file_b = tempfile.mkstemp(dir=os.environ['DJANGO_TEST_TEMP_DIR'])
+ handle_a, self.file_a = tempfile.mkstemp()
+ handle_b, self.file_b = tempfile.mkstemp()
# file_move_safe should raise an IOError exception if destination file exists and allow_overwrite is False
self.assertRaises(IOError, lambda: file_move_safe(self.file_a, self.file_b, allow_overwrite=False))