diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2015-02-21 21:09:30 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-03-07 10:40:17 -0500 |
| commit | 311b880fa96ecafb4d52417505548e4a5822cc96 (patch) | |
| tree | 5b8f5ff5cc1c36b9a0d207006cf9a490c1c778c0 | |
| parent | 1ae2df6bfc3afadd7edb29a5887711f70cdb52c6 (diff) | |
[1.8.x] Prevented some tests from writing in the CWD.
Backport of 90b069c33f3f8785a7d068a2032f130d2dbb0c75 from master
| -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 b62e259f78..f0a76f5182 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, |
