Drug tests check for 5 main drugs. I'm not to sure on the other 4 but one of them is pot. It doesn't even really check for thc, it checks for the metabolites thc breaks down into.
I believe poppy seeds contain opioids, not canabinoids. Tests these days wont confuse the two.
In regards to the "my friends were smoking and i was around them" defence, that doesn't really work. There is a certain amount of thc/thc byproduct that must be in your system to test positive, and since he was "tokin up like crazy", it's safe to say that he is way past that point.
(I think... this is what i remember... i read all this shit while i was stoned/smoking, so I don't know if I'm remembering this correctly)