A Fistful of Dynamite

In 1913 Mexico at the time of the Revolution. Juan Miranda (Rod Steiger), a Mexican outlaw leading a bandit family, meets John 'Sean' Mallory (James Coburn), an Irish Republican explosives expert on the run from the British. Noting his skill with explosives, Juan relentlessly tries to make him join a raid on the Mesa Verde national bank. John in the meantime has made contact with the revolutionaries and intends to use his dynamite in their service. The bank is hit as part of an orchestrated revolutionary attack on the army organized by Doctor Villega (Romolo Valli). Juan, interested only in the money, is shocked to find that the bank has no funds and instead is used by the army as a political prison. John, Juan and his family end up freeing hundreds of prisoners, causing Juan to become a "great, grand, glorious hero of the revolution".The revolutionaries are chased into the hills by an army detachment led by Colonel Günther Reza (Antoine Saint-John). John and Juan volunteer to stay behind with two machine guns and dynamite. Much of the army's detachment is destroyed while crossing a bridge which is machinegunned by them and blown to bits by John. Col. Reza who commands an armoured car, survives. After the battle, John and Juan find most of their comrades, including Juan's family and children, have been killed by the army in a cave. Engulfed with grief and rage, Juan goes out to fight the army singlehanded and is captured. John sneaks into camp where he witnesses executions of many of his fellow revolutionaries by firing squad. They had been informed on by Dr. Villega, who has been tortured by Col. Reza and his men. This evokes in John memories of a similar betrayal by Nolan (David Warbeck), his best friend, whom John kills for informing. Juan faces a firing squad of his own, but John arrives and blows up the squad and the wall with dynamite just in time. They escape on a motorcycle John is driving.John and Juan hide in the animal coach of a train. It stops to pick up the tyrannical Governor Don Jaime (Franco Graziosi), who is fleeing (with a small fortune) from the revolutionary forces belonging to Pancho Villa and Emiliano Zapata. As the train is ambushed, John, as a test of Juan's loyalty, lets him choose between shooting the Governor and accepting a bribe from him. Juan kills Jaime, and also steals the Governor's spoils. As the doors to the coach open, Juan is greeted by a large crowd and again unexpectedly hailed as a great hero of the revolution. He throws the money back into the coach to John.On a train with commanders of the revolution, John and Juan are joined by Dr. Villega, who has escaped. John alone knows of Villega's betrayal. They learn that Pancho Villa's forces will be delayed by 24 hours and that an army train carrying 1,000 soldiers and heavy weapons, led by Col. Reza, will be arriving in just 3 hours, which will surely overpower the rebel position. John suggests they rig a locomotive with dynamite and send it head on. He requires one other man, but instead of picking Juan, who volunteers, he chooses Dr. Villega. It becomes clear to Villega that he knows of the betrayal. John nonetheless pleads with him to jump off the locomotive before it hits the army's train, but Villega feels guilty and stays on board. John jumps in time and the two trains collide, killing Villega and a number of soldiers.The revolutionaries' ambush is successful, but as John approaches to meet Juan, he is shot in the back by Col. Reza. An enraged Juan riddles the Colonel's body with a machine gun. As John lies dying, he continues to have memories of his best friend, Nolan, and a young woman both apparently loved. John recalls killing Nolan after being betrayed by him to the law. Juan kneels by his side to ask about Dr. Villega. John keeps the doctor's secret and tells Juan that he died a hero of the revolution. As Juan goes to seek help, John has a flashback to his time in Ireland with Nolan and a girl whom they both were in love with; knowing his end is near, sets off a second charge he secretly laid in case the battle went bad. The film ends with Juan staring at the burning remains, asking forlornly: "What about me?"

Question: Who does John test for loyalty?
Answer: Juan