Skip to content

Commands

These fixtures are related to Django management commands.

Functions

command_makemigrations

command_makemigrations(conf_app_name)

Allows to run makemigrations command.

Note

This command can be useful to generate migrations for your application (without a project creation).

def test_makemigrations(command_makemigrations):
    command_makemigrations()

command_run

command_run()

Allows management command run.

1
2
3
def test_this(command_run, capsys):
    result = command_run('my_command', args=['one'], options={'two': 'three'})
    out, err = capsys.readouterr()

Warning

Django < 1.10 will always return None, no matter what command returns.

Command output.