@pytest.mark.cmd
def test_cmd_contributors_mutually_exclusive(capfd):
 with pytest.raises(CommandError) as e:
  call_command('contributors', '--include-anonymous', '--mailmerge')
 assert ('argument --mailmerge: not allowed with argument --include-anonymous' in str(e))
 with pytest.raises(CommandError) as e:
  call_command('contributors', '--mailmerge', '--include-anonymous')
 assert ('argument --include-anonymous: not allowed with argument --mailmerge' in str(e))

@ pytest . mark . cmd def test_cmd_contributors_mutually_exclusive ( capfd ) : with pytest . raises ( CommandError ) as e : call_command ( 'contributors' , '--include-anonymous' , '--mailmerge' ) assert ( 'argument --mailmerge: not allowed with argument --include-anonymous' in str ( e ) ) with pytest . raises ( CommandError ) as e : call_command ( 'contributors' , '--mailmerge' , '--include-anonymous' ) assert ( 'argument --include-anonymous: not allowed with argument --mailmerge' in str ( e ) )
test mutually exclusive arguments are not accepted .