how long should I wait to take a pregnancy test?

Hypothetically you were to have sex on the 1st of the month (unprotected) which is one week before your period is scheduled. when should you take a test.