Leonardo DiCaprio may be dating Rihanna, and he’s most likely even banging Rihanna — but he absolutely did not get her pregnant … according to a lawsuit he’s filed against a French magazine.

Leo filed the suit against Oops! for its May 28 cover story … which declares that Leo knocked up RiRi, and will not recognize the baby as his. In the docs, Leo’s lawyer calls the story “pure fantasy.”

Here’s what’s odd — sources close to Leo tell TMZ … his team recently contacted Oops! and informed the people running the magazine that the story was false. We’re told the mag’s response went something like … yeah, we know and we don’t care — except in French.

One source tells us it’s almost like the magazine wanted to be sued, possibly just to gain publicity.

In the suit — first reported by Gossip Cop — Leo is demanding Oops! fork over 18,000 euros (about $20,000) in damages and attorney fees. That amount is the maximum allowed under French law.