Well, sort of.
The latest episode of
Doctor Who,
The Shakespeare Code, contained several references to Harry Potter, including mentions of
Deathly Hallows and the use of a spell which saved the day.
The story took place in Elizabethan England, around the time of Shakespeare. But an evil force, the Carrionites, under the guise of witches, threatened to use the debut of Love's Labour's Won to destroy the world.
Upon discovering the use of witchcraft, Martha Jones, The Doctor's newest companion, declared "It's all a bit Harry Potter" to which The Doctor (played by Barty Crouch Jnr actor David Tennant) responded, "Wait until you read Book 7. Oh, I cried!"
(It's worth noting this episode was in production last summer, at which point neither the title nor the release date had been announced...indeed, Jo hadn't even finished the book!)
The episode focused on the power of words. So to banish the Carrionites, Shakespeare had to use his literary skills. Toward the end of his speech, he struggled to find a word that rhymed...when Martha suggested "Expelliarmus!" which, in turn, saved the day. The Doctor then cheered, "Good old JK!"
Indeed.
The scenes in which Harry Potter was referenced, can be seen
here.