diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2015-02-21 21:09:30 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2015-03-07 15:56:15 +0100 |
| commit | 90b069c33f3f8785a7d068a2032f130d2dbb0c75 (patch) | |
| tree | 96e09876c072fd50cf03997598b380daeb6d97ab | |
| parent | 9eab3284447692b26f92d4b64cc8b4df78a8c5ef (diff) | |
Prevented some tests from writing in the CWD.
| -rw-r--r-- | tests/fixtures/tests.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/fixtures/tests.py b/tests/fixtures/tests.py index e81aea8f6f..f809c349f7 100644 --- a/tests/fixtures/tests.py +++ b/tests/fixtures/tests.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals import os +import tempfile import warnings from django.apps import apps @@ -46,6 +47,8 @@ class DumpDataAssertMixin(object): natural_foreign_keys=False, natural_primary_keys=False, use_base_manager=False, exclude_list=[], primary_keys=''): new_io = six.StringIO() + if filename: + filename = os.path.join(tempfile.gettempdir(), filename) management.call_command('dumpdata', *args, **{'format': format, 'stdout': new_io, 'stderr': new_io, |
