How long do you have to wait to take a pregnancy test after having sex?

ve

I heard two weeks but can 1 week show accurate results ?