diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2015-02-21 18:56:36 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@oscaro.com> | 2015-02-23 16:55:26 +0100 |
| commit | 934400759de817471ff37d736686201d7ae34e82 (patch) | |
| tree | 834ceac28e66f7d81350a79a7f23fdb71e6cb1f4 /tests/admin_views | |
| parent | e83aba0e2cce16cd1b32d1c172239a4e20867e95 (diff) | |
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/admin_views')
| -rw-r--r-- | tests/admin_views/admin.py | 2 | ||||
| -rw-r--r-- | tests/admin_views/models.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/admin_views/admin.py b/tests/admin_views/admin.py index aa5a336f4f..263008aeb5 100644 --- a/tests/admin_views/admin.py +++ b/tests/admin_views/admin.py @@ -309,7 +309,7 @@ class OldSubscriberAdmin(admin.ModelAdmin): actions = None -temp_storage = FileSystemStorage(tempfile.mkdtemp(dir=os.environ['DJANGO_TEST_TEMP_DIR'])) +temp_storage = FileSystemStorage(tempfile.mkdtemp()) UPLOAD_TO = os.path.join(temp_storage.location, 'test_upload') diff --git a/tests/admin_views/models.py b/tests/admin_views/models.py index c4d247d56c..07f6864cf5 100644 --- a/tests/admin_views/models.py +++ b/tests/admin_views/models.py @@ -316,7 +316,7 @@ class EmptyModel(models.Model): return "Primary key = %s" % self.id -temp_storage = FileSystemStorage(tempfile.mkdtemp(dir=os.environ['DJANGO_TEST_TEMP_DIR'])) +temp_storage = FileSystemStorage(tempfile.mkdtemp()) UPLOAD_TO = os.path.join(temp_storage.location, 'test_upload') |
