@pytest.mark.cmd
@pytest.mark.django_db
def test_cmd_contributors(capfd, dummy_contributors, default_contributors_kwargs, contributors_kwargs):
 result_kwargs = default_contributors_kwargs.copy()
 result_kwargs.update(contributors_kwargs)
 cmd_args = []
 for k in ['project', 'language']:
  if result_kwargs[('%s_codes' % k)]:
   for arg in result_kwargs[('%s_codes' % k)]:
    cmd_args.extend([('--%s' % k), arg])
 for k in ['since', 'until']:
  if result_kwargs[k]:
   cmd_args.extend([('--%s' % k), result_kwargs[k]])
   result_kwargs[k] = make_aware(parse_datetime(result_kwargs[k]))
 if result_kwargs['sort_by']:
  cmd_args.extend(['--sort-by', result_kwargs['sort_by']])
 call_command('contributors', *cmd_args)
 (out, err) = capfd.readouterr()
 assert (out.strip() == str('\n'.join((('%s (%s contributions)' % (k, v)) for (k, v) in result_kwargs.items()))))

@ pytest . mark . cmd @ pytest . mark . django_db def test_cmd_contributors ( capfd , dummy_contributors , default_contributors_kwargs , contributors_kwargs ) : result_kwargs = default_contributors_kwargs . copy ( ) result_kwargs . update ( contributors_kwargs ) cmd_args = [ ] for k in [ 'project' , 'language' ] : if result_kwargs [ ( '%s_codes' % k ) ] : for arg in result_kwargs [ ( '%s_codes' % k ) ] : cmd_args . extend ( [ ( '--%s' % k ) , arg ] ) for k in [ 'since' , 'until' ] : if result_kwargs [ k ] : cmd_args . extend ( [ ( '--%s' % k ) , result_kwargs [ k ] ] ) result_kwargs [ k ] = make_aware ( parse_datetime ( result_kwargs [ k ] ) ) if result_kwargs [ 'sort_by' ] : cmd_args . extend ( [ '--sort-by' , result_kwargs [ 'sort_by' ] ] ) call_command ( 'contributors' , * cmd_args ) ( out , err ) = capfd . readouterr ( ) assert ( out . strip ( ) == str ( '\n' . join ( ( ( '%s (%s contributions)' % ( k , v ) ) for ( k , v ) in result_kwargs . items ( ) ) ) ) )
contributors across the site .