If depends on the test.
Lab tested Urine, it will be at least 28 days before a clean test can be expected.
On the spot test cards, 2 weeks clean may do it, it depends on your body.
Buy test cards off the internet and test yourself to find out how your metabolism works and how long it takes you to be clean (you've got to be willing to stay clean for a while) I have discovered that after evening smoking of 1 bowl per night for a period of 30 days or over, that it takes me about 3 week to pass my own test card test, two weeks if I slam large amounts of water down constantly 4 hours before and up to the time I tested myself. This is always useful information that is well worth the money, if testing is a concern and a positive can have catastrophic consequences to you and your families livelihood.
Huge amounts of water just before testing may help (Dilution is the solution)
If you know when you are being tested and don't think you will be clean and nobody's going to be looking over your shoulder or staring at your crouch, I would buy clean urine off the internet.
There are a lot of snake oil salesmen out there and I have't found a test clean product yet that works as advertised other than clean synthetic urine.
Again, buy your own test kits and find out where you're at.
Good Luck, I know testing can be a very anxious time.