Skip to content

merge_fixtures should write to stdout #72

@florianm

Description

@florianm

Just a consistency issue: dump_objects writes to stdout, while merge_fixtures doesn't.

I want to use the commands from functions, so capturing stdout is easy:

    with open("my_app/fixtures/test_fixture.json", 'w+') as f:
        call_command('dump_object', 'my_app.MyModel *list_of_some_pks, '-k', '-n', stdout=f)
        f.readlines()

Whereas trying to merge fixtures the same way fails (or I fail to capture the output):

with open("my_app/fixtures/test_fixtures_combined.json", 'w+') as f:
        call_command(
            "merge_fixtures",
            "my_app/fixtures/test_fixture_1.json",
            "my_app/fixtures/test_fixture_2.json",
            stdout=f
        )
        f.readlines()

Is this intended behaviour?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions