Like most drugs (with the notable exception of marijuana) opiates take only a few days to leave your system, anyway. They normally take around 3 to 5 days to leave your system, although it could possibly take over a week for very heavy, long-term users.
So if you have a few days before the test, just stop using, and hopefully you will pass the test honestly. If you cannot stop using because you are physically addicted to the opiates…well, then you probably should not be looking for a job, anyway. You should be in treatment.
If, for whatever reason, you do not have the luxury of going into rehab right now, and you cannot stop using opiates because you are physically addicted, then you could try taking Suboxone.
Suboxone is used for the treatment of mild to moderate opiate addiction. Suboxone is itself an opiate, but it does not get you high, so you can quit getting high on opiates without suffering withdrawal.
Suboxone does not show up on drug tests. So if you can get your hands on some Suboxone, you could take it for a few days and pass the test. And of course, if you are so inclined, you can get an appointment with a doctor who is licensed to prescribe Suboxone, and continue your treatment after the drug test.
See the Related Link below for a Burprenorphine Physician and Treatment Center Locator (buprenorphine is the main ingredient in Suboxone). Unfortunately, I have only been able to find a Burprenorphine Physician and Treatment Center locator for the United States, so I hope you live in the U.S.