Poppy seeds contain both Morphine and Codeine and can cause false positives for Opiates in urine tests. Most Opiate urine tests have a cut off level of 300 ng/ml. Ingestion of a single poppy seed bagel can produce an opiate level somewhere around 250 ng/ml three hours later. 3 teaspoons of store bought poppy seeds can result in 1200 ng/ml 6 hours later (1). We have read an estimate that 70% of DOT opiate positives are from poppy seeds. The U.S. Military uses cut off levels of 3000 ng/ml in order to minimize false positives.
The profile and levels of Opiates that show up in a urine test can generally be distinguished from Opiate use if care is taken...however it is not a simple thing and results are often mis-read by companies giving drug tests. If eaten recently and in great enough quantity, poppy seeds will result in positive morphine and codeine results, with morphine predominant. This can be distinguished from recent Codeine use because of the comparative levels of Morphine and Codeine present. However Codeine use in the past (not recent) can result in a similar profile as Morphine is a metabolite of Codeine. Codeine is eliminated from the system more quickly than Morphine, so an extended period after Codeine use, levels of Morphine may be higher than those of Codeine.
The Discovery Channel's MythBusters show did a piece testing whether poppy seeds could cause a false positive on an over-the-counter drug test. Two people were tested for opiates before the experiment began. Both tested negative on this initial test. One person then ate three poppy seed bagels and the other ate poppy seed cake. Both tested positive for opiates within 30 minutes of ingesting the seeds and continued to test positive until 16 hours after ingestion. The same brand of drug test was used in all cases. They called a number of manufacturers of over-the-counter drug tests and were told by all but one that poppy seeds could not cause a false positive.