Copyright considers things a unique work if less than something like 10% is copied. Harry Potter is in no danger. Even changing the golden ticket to a letter is enough to get around infringement there.
Of course consult a lawyer if the 10% figure above it important to your copy - there are lots of details that I don't know.
I only felt the need to establish enough similarity to demonstrate that the joke was funny, not so much the Dahl estate could take Rowling's hard-earned money. :)
Of course consult a lawyer if the 10% figure above it important to your copy - there are lots of details that I don't know.