In the past week, actual Republican presidential candidate Donald Trump has seriously invoked both racial and religious tests for judges. He argues that the judge overseeing the lawsuit against Trump University can't be Hispanic or Muslim because, in essence, Trump has said bigoted things about both groups, so that might bias a judge against him.
On the one hand, a racial and religious test for a government job is obviously racist and bigoted. It doesn't get more prejudiced than denying someone a job simply because of his or her race, ethnicity, or religion.
But Trump's rationale is also extremely impractical from a legal standpoint. As Eugene Volokh, a prominent libertarian academic and law professor at UCLA, told BuzzFeed:
Trump's theory is, apparently, that anyone can get any judge disqualified for "conflict of interest" just by saying things that the judge finds offensive enough. Don't like the Jewish judge on your case? Say things that are critical of Jews, and now the judge presumably has to step aside because of a conflict of interest. Don't like the female judge? Say things that women tend to find offensive. Don't like the judge who was a Republican activist? Say nasty things about Republicans. For obvious reasons, that is not the law, because it can't be the law. Judges can't be disqualified from a case because of their ethnicity, or because of their ideology, or because you say things that are offensive to them or their ethnic group.
So by his standard, Trump could get any judge dismissed simply by insulting a group he or she belongs to. Trump may assume this is an ingenious legal strategy, but in reality it's so impractical that a prominent law professor says it literally can't be the case.