BIARRITZ, France — President Donald Trump’s confidence in his ability to use personal relationships to advance his policy objectives is about to face its stiffest test yet.

Trump is set to meet this weekend with British Prime Minister Boris Johnson for the first time since the latter was elected last month. In the runup to the meeting, the president and his aides have repeatedly emphasized Trump’s close relationship with Johnson. But divergent policy and political aims of the two, combined with Trump's track record with other European leaders, could throw obstacles in the way of any lasting friendship.

The president has paid Johnson perhaps his highest compliment, noting some people call him “Britain Trump,” and saying he was "very, very happy,” after Johnson’s election. National security adviser John Bolton boasted during a visit to London last week that Trump and Johnson's relationship is “off to a roaring start.”

Such sentiments have raised expectations that the leaders' rapport will help them narrow differences on issues such as Iran and China while also agreeing on ambitious trade pacts over the next two months to try to minimize the economic fallout from the United Kingdom’s planned exit from the European Union.

But the backdrop of their maiden meeting — the Group of Seven Summit — underscores the limitations of a personal friendship.

Few world leaders are more familiar with the risks of banking on the hope that a personal relationship with Trump will pay policy dividends than members of the G-7. Over the past three years, Trump’s G-7 allies have become frenemies and mere acquaintances have turned into adversaries.

Ghosts of friendships past

Through it all, Trump has shown himself to be, at best, a fair-weather friend.

French President Emmanuel Macron made such a public show of forging a personal relationship with Trump that theirs was dubbed a “bromance.” Yet, Macron couldn’t change Trump’s mind on Iran or climate change policy, and now the two leaders are in an economic standoff, with Trump threatening to slap tariffs on French wine.

Japanese Prime Minister Shinzo Abe decided to cultivate a personal relationship with Trump before he was even in the White House and has invested heavily in it since. Yet, despite rounds of golf, Wagyu beef and even a sumo wrestling tournament, Trump has bucked Abe on how to handle the nuclear threat from North Korea; he’s suggested upending a long-standing U.S. security treaty with Japan; and he’s threatened to adopt tariffs on Japanese cars.

Giuseppe Conte, Italy’s populist prime minister, is as friendly a face as Trump could find on the world stage. A lawyer with no political experience, he’s praised Trump for having positions that are “expressed with clarity” and offered to be America’s “privileged interlocutor” to Europe. But Conte just resigned amid the government's widening political divisions.

The G-7 leaders who’ve made less of an effort to woo Trump directly — German Chancellor Angela Merkel and Canadian Prime Minister Justin Trudeau — have received similar results on substance as those who sought a personal rapport. They've also faced more critical rhetoric from the U.S. president.

Merkel — a target of Trump’s during his 2016 campaign — initially tried to play the president’s relationship game by inviting his daughter, Ivanka, to appear an event with her in Berlin. But it quickly became clear that no amount of effort would tamp down Trump’s criticism. The president has continued to threaten tariffs on German cars and attacked the European Union as Merkel tries to hold the bloc together. After Trump stormed out of last year’s G-7 early, Merkel said his refusal to sign a joint communique with the other leaders was “depressing.”

Trudeau similarly tried the familial route to Trump’s heart — working with the president's son-in-law, Jared Kushner, on trade. But that didn’t spare him the president’s ire. When Trump didn’t get what he wanted from Trudeau on trade, he dismissed his Canadian counterpart as "dishonest and weak.”

Early signs of tension

Johnson is Trump’s clear new favorite. Their meeting this weekend at the G-7 summit in the seaside town of Biarritz on France’s southwestern coast could offer the first indication of how their relationship might weather their policy differences and domestic political aspirations over the next few months.

Johnson holds the unique position of being someone Trump called a friend before he became a world leader. And the two have more in common than blunt talk and unruly hair. As a presidential candidate, Trump supported the policy that ultimately elevated Johnson to prime minister — Brexit.

It’s a position Trump likes to remind Johnson he took, regularly noting in their discussions that he predicted the United Kingdom would vote in favor of it, according to a person who has been present for some of their calls.

Johnson and Trump have spoken on the phone about once a week since the prime minister’s election, according to public statements by both governments.

And U.S. officials said the two leaders will make an announcement at their meeting on progress in a trade talks aimed at reaching agreements that would go into effect at the U.K.’s planned Oct 31 exit from the E.U.

But the populist leaders have differences over key issues, most notably the Iran nuclear deal — from which Trump withdrew the U.S. last year — and Britain’s use of equipment from the Chinese telecommunications giant Huawei. The White House wants Johnson to declare the Iran deal as dead, and to block all Huawei equipment in the U.K., officials said. It’s unclear that Johnson will agree to either.

Johnson has backed the U.K.’s position of sticking with the Iran deal. He said last month that he wouldn’t join any U.S. effort for military action against Iran at this time, adding that “diplomacy must be the best way forward.”

Whether he changes his position to more closely align with Trump’s remains to be seen.

“I don’t think they have a relationship that is so close that it can wear friction,” Nick Greenstock, a co-founder of the London-based geopolitical consulting firm GateHouse Advisory Partners, said. “And I suspect given the nature of both characters, which is impulsive, they're going to find ways to bump into and aggravate one another.”

The new prime minister also has to mind his domestic political flank, and Trump is widely unpopular in the country he’s trying to lead.

One British government official who is close to Johnson said it’s helpful that Trump and Johnson can easily talk to each other, but predicted the prime minister is likely to be more cautious than the president at the G-7 as he tries to balance his politics back home.

“Boris will be more nuanced than President Trump,” the official said.

Johnson has already shown daylight between him and Trump. When asked during a debate last month about Trump telling U.S. congresswomen of color to “go back” where they came from if they don’t like the U.S., he sharply disagreed with the president.

“I think it was totally unacceptable,” Johnson said, though refusing to disclose whether he believed Trump’s comments were racist.

"If you're the leader of a great multiracial, multicultural society, you simply cannot use that kind of language about sending people back to where they came from," Johnson said. "That went out decades and decades ago and thank heavens for that."

His rebuke of Trump caught the attention of some officials in the White House who wondered if the honeymoon was over before it began.