File: test_fixtures_commands.py

package info (click to toggle)
python-pytest-djangoapp 1.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 396 kB
  • sloc: python: 1,116; makefile: 114; sh: 6
file content (24 lines) | stat: -rw-r--r-- 521 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from django import VERSION


def test_command_run(command_run, capsys):

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

    assert 'bingo' in out
    assert 'bongo' in err

    if VERSION >= (1, 10):
        assert result == 'one|three'


def test_command_migration(command_makemigrations, capsys):

    result = command_makemigrations()
    out, err = capsys.readouterr()

    assert result is None

    assert 'No changes' in out
    assert err == ''