It depends on when your test is. If you have about two weeks to prepare, you should be fine.
Considering its a pee-test, the best thing to do is make an attempt to get as much of the metabolite that is tested out of your body. They don't specifically test for THC, but rather another non-psychoactive called THC-COOH or something along the lines of that. After a crap load of research, I think these are the best means of being able to pass a drug test:
1. Exercise. It speeds up your metabolism.
2. Take in liquids, preferably water and diuretics. Water is not a diuretic in itself. Diuretics, such as a pill, will make you piss if you took it early in the morning with 1 sip of water. Coffee is a diuretic. So is Cranberry juice (make sure its 100% juice, not that blended crap). Green tea. Here is a list:
http://hubpages.com/hub/Natural-Diuretics
3. Fiber. You wouldn't think so, but a lot of the THC metabolites are actually expelled through your shit. No kidding. Soluble fiber, the kind that binds with water, is best in this case. It will make a lining around your intestinal wall, which will make it harder for the metabolites to be absorbed and make their way into your piss. So go to a store, get some Metamucil (I recommend a flavored one), and take it once in the morning and once at night. Make sure you drink plenty of water. Don't let this up.
4. B-Vitamins and Riboflavin.
5. Creatine. Go to a GNC or Walgreens and pick up this powdery substance. Creatinine, a product of creatine, is tested to measure dilution when it comes to water dilution. Considering you'll probably drink a shitload of water the day of the test, putting more creatine in your body will bump the ratio up to a normal level.
6. Don't smoke. I love weed too, but I love making money. If you can't go a couple weeks without smoking, check yourself out. Remember: DO THE DRUG, DON'T LET THE DRUG DO YOU.