@pytest.mark.django_db
def test_contributors_include_anon(member, anon_submission_unit):
 anon = User.objects.get(username='nobody')
 contribs = Contributors(include_anon=True)
 someuser = UserFactory()
 assert (contribs.include_anon is True)
 assert (list(contribs.user_qs) == list(User.objects.exclude(username__in=['system', 'default'])))
 assert (someuser in contribs.user_qs)
 assert (anon in contribs.user_qs)
 assert (sorted(contribs) == sorted(contribs.contributors) == sorted(set(contribs.user_qs.filter(contribs.user_filters).values_list('username', flat=True))) == sorted(set(contribs.user_qs.filter(submission__gt=0).values_list('username', flat=True))))
 for username in contribs:
  assert (contribs[username] == contribs.contributors[username])
  assert (username in contribs)
 assert (anon.username in contribs)
 assert (contribs.contributors == _contributors_list(contribs))

@ pytest . mark . django_db def test_contributors_include_anon ( member , anon_submission_unit ) : anon = User . objects . get ( username = 'nobody' ) contribs = Contributors ( include_anon = True ) someuser = UserFactory ( ) assert ( contribs . include_anon is True ) assert ( list ( contribs . user_qs ) == list ( User . objects . exclude ( username__in = [ 'system' , 'default' ] ) ) ) assert ( someuser in contribs . user_qs ) assert ( anon in contribs . user_qs ) assert ( sorted ( contribs ) == sorted ( contribs . contributors ) == sorted ( set ( contribs . user_qs . filter ( contribs . user_filters ) . values_list ( 'username' , flat = True ) ) ) == sorted ( set ( contribs . user_qs . filter ( submission__gt = 0 ) . values_list ( 'username' , flat = True ) ) ) ) for username in contribs : assert ( contribs [ username ] == contribs . contributors [ username ] ) assert ( username in contribs ) assert ( anon . username in contribs ) assert ( contribs . contributors == _contributors_list ( contribs ) )
contributors across the site .