def test_suppress_leaderboard_when_options_set(self): hidden_profile = Profile.objects.create( data={}, handle="hidden_user", hide_profile=True, ) assert should_suppress_leaderboard("hidden_user") == True hidden_profile.delete() suppressed_profile = Profile.objects.create(data={}, handle="suppressed_user", suppress_leaderboard=True, hide_profile=False) assert should_suppress_leaderboard("suppressed_user") == True suppressed_profile.delete()
def test_show_leaderboard_when_user_exists_and_not_hiding(self): public_profile = Profile.objects.create( data={}, handle="public_user", hide_profile=False, suppress_leaderboard=False, ) assert should_suppress_leaderboard("public_user") == False public_profile.delete()
def test_show_leaderboard_when_profile_does_not_exist(self): assert should_suppress_leaderboard("random_user_name_9876") == False
def test_suppress_leaderboard_when_missing_user_handle(self): assert should_suppress_leaderboard(None) == True