Will a pregnancy test work if your 2 weeks pregnant?

A pregnancy test should be accurate about 14 days after you had sex.