‘I wonder if Kenan Malik is clear that the ‘Don’t mention the war’ episode of Fawlty Towers is intended to make fun of the British obsession with the Second World War that he criticises?” So wrote an irate John Cleese to the Independent in 1992 in response to an early op-ed of mine on British perceptions of racism in Germany. Yes, I was clear that Cleese had been satirising the British obsession – and brilliantly – but my mention of that Fawlty Towers episode was no doubt clumsy enough to draw Cleese’s ire.

I thought about that letter, and that episode of Fawlty Towers, after the infamous Leave.EU tweet last week. “We didn’t win two world wars to be pushed around by Krauts,” it snorted, in response to Angela Merkel’s supposed demand, in a telephone conversation with Boris Johnson, that Northern Ireland must “forever” stay within the EU customs union.

Thirty years ago, that tweet (had Twitter existed) would have seemed unexceptional. Baiting “Krauts” was then a tabloid sport.

Last week, it drew a torrent of criticism and not just from the usual suspects. Even the Brexit party’s Richard Tice was offended. Leave.EU eventually deleted the tweet and apologised (well, sort of).

There is more than a whiff of hypocrisy about some of this criticism. Tice, after all, was co-founder with Arron Banks of Leave.EU and had no problem with the infamous “breaking point” poster unveiled by Brexit party leader Nigel Farage. Nevertheless, the kerfuffle over the tweet shows how British attitudes have changed.

Nazism remains for most people the touchstone of evil, even if, in an age in which every brutal dictator is a “new Hitler” and every politician with reactionary views a “fascist”, the term has become so relativised as to be almost meaningless. The Second World War, however, no longer occupies the place it once did in British consciousness.

When Basil Fawlty was failing not to mention the war, that war provided for Britain a historical moment of triumph with which to buttress a less-than-triumphant present. Taunting Germany about defeat, whether on the battlefield or the football pitch, became as much a part of being British as complaining about a wet summer.

The Leave.EU tweet about Angela Merkel. Photograph: Twitter/@arron_banks

Britain’s need to draw on the past to buttress the present is probably more urgent than it was 30 years ago. But, as Leave.EU discovered, anti-German chauvinism no longer provides the resources necessary for the task.

The irony is that for many people, Germany stands condemned today not for its historic Nazism but for its contemporary liberalism. Angela Merkel’s decision in 2015 to open the borders to migrants and refugees, and its role in helping the growth of the far right, reveals for many the dangers of an overweening liberalism, that, in their eyes, has unleashed darker forces – witness the attack last week, during Yom Kippur, on a synagogue in the German city of Halle by a far-right gunman. This view of the supposed liberalism of Germany and the EU over immigration is, as I have argued, disturbingly mistaken, as are the claims about the reasons for the rise of the far right. The shift in British perceptions of Germany is nevertheless expressive of the wider recasting of political attachments and faultlines.

Brexit has thrown into turmoil not simply traditional political alignments but also Britain’s understanding of itself and of its place in the world. From debates about “global Britain” to worries about the union, the question of what Britain stands for seems less certain. The past has become a battlefield in the struggle to define the present. The bicentenary of the Peterloo massacre in August was, for instance, notable for attempts by both Brexiters and Remainers to claim its legacy as their own, to draw from the 19th-century struggle for democracy lessons for the meaning of democracy today.

The shifting perceptions of Germany also speak to this contestation over the past. The Second World War has helped anchor Britain’s sense of itself as a nation, not just as the last moment when it could act as a world power but also because the Holocaust provided an unalloyed moral symbol of evil.

In her book Learning From the Germans, the philosopher Susan Neiman observes that the enormity of the Holocaust has forced Germany to address the darkest aspects of its past. But it has also allowed Britain and America not to do so, to avoid thinking too deeply about the history of slavery or of empire, to minimise their horrors in comparison with the Holocaust.

The turmoil over Brexit is throwing many of the old certainties into question. The question is – will we use that uncertainty to have a grown-up debate about history and identity?

• Kenan Malik is an Observer columnist