President Trump is cynically trying to overturn the election results based on claims of fraud that are themselves fraudulent. He is unlikely to succeed. But if he did, the United States’ 232-year history as a democracy would be finished. Now is a time of testing: Do you stand with the democrats or the autocrats?

Unfortunately, most Republicans are failing this test — just as they have failed every other test during Trump’s presidency. According to Axios, only six Republican senators (out of 53), seven Republican governors (out of 26) and 10 Republican members of the House (out of 197) have thus far acknowledged that Joe Biden won. That means fewer than 1 in 10 of the most senior elected Republicans publicly stands behind our electoral system. Even fewer have followed Sen. Mitt Romney (R-Utah) in warning that Trump’s unfounded claim of election-rigging “damages the cause of freedom.”

Sen. Lindsey O. Graham (R-S.C.) has often championed freedom abroad, but now he is a threat to freedom at home. The Republican secretary of state in Georgia, Brad Raffensperger, says that the chairman of the Senate Judiciary Committee pressured him to throw out as many ballots as possible in a state that Biden won narrowly. (Graham denies it.) Anyone who thought that Lickspittle Lindsey would grow a spine now that he has been reelected — and Trump defeated — will be disabused of that illusion.

Most Republicans aren’t as egregious as Graham. They’re simply cowards who offer mealy-mouthed support for Trump’s election challenges. Asked on Tuesday whether he considers Biden the president-elect, outgoing Sen. Cory Gardner (R-Colo.) replied: “I’m not going to play your gotcha questions.” Actually, it’s an easy question — if you have any integrity. Which Gardner clearly does not. Neither, it seems, does General Services Administrator Emily Murphy, who is blocking federal agencies from working with the Biden transition team.

These dismaying displays of Republican cravenness will be no surprise after the past four years. The pleasant surprise is that so many Republican election officials are refusing to go along with this dangerous charade. Raffensperger deserves pride of place for shrugging off death threats and pressure from Georgia’s two Republican senators to affirm the integrity of the election results. But he’s hardly alone. Other state and local Republicans, including the GOP secretaries of state in 29 states, have also refused to endorse Trump’s phony allegations of fraud.

Their courage has been matched by Christopher Krebs, a Trump appointee who until Tuesday evening was in charge of the Department of Homeland Security’s Cybersecurity and Infrastructure Security Agency. He led a successful effort to safeguard the election. He knew he would likely be “terminated” by Trump for affirming that claims of voter fraud are either “unsubstantiated” or “technically incoherent” — and he was. But he did his duty anyway. He deserves a medal of freedom from President Biden.

Judges have been equally stalwart. Trump made no secret of his expectation that jurists he has appointed, especially on the Supreme Court, would give him a second term. So far he has been disappointed. By one tally, the Trump team is 1 for 25 in election lawsuits — and the one win (in Pennsylvania) does nothing to change the outcome. Facts might not matter in this White House, but, mercifully, they still matter in court.

Two other institutions that we often take for granted — the military and the media — also deserve a shout-out. The U.S. armed forces are firmly apolitical, and this election has been no different despite Trump’s disturbing purge of Pentagon officials. Gen. Mark A. Milley, chairman of the Joint Chiefs of Staff, pointedly noted on Veterans Day: “We do not take an oath to an individual. ... We take an oath to the Constitution.” Translation: This isn’t Belarus or Zimbabwe. The military won’t lift a bayonet to save a president repudiated by the voters.

While the armed forces are to be commended for inaction, the media deserves credit for its actions. Prior to the election, mainstream media refused to credulously repeat Trump lawyer Rudolph W. Giuliani’s conspiracy theories about Hunter Biden’s laptop. Since the election, the media have stuck to hard-nosed coverage of the results while dispelling Trump’s crackpot claims of fraud. There are obvious and destructive exceptions — e.g., Newsmax and the Federalist — but even Fox News’s news division, if not its prime-time propagandists, has been more responsible than Trump would like.

The whole Trump presidency has been a stress test of our democracy. If our republic survives, it will be in large part thanks to the voters who gave Biden such a substantial victory. Imagine how much worse the crisis would be if the whole outcome turned on, say, Arizona, where Trump lost by fewer than 11,000 votes.

But it will also be thanks to all of the officials who have acted to uphold the results, and no thanks to all those who have acted to throw them out. We will never forget either the heroes or the villains — the courageous and the cowardly — in this democratic drama. They will wear their honor, or lack thereof, until their dying day.

Watch Opinions videos:

Read more: