Panicking

So i had unprotected sex last week, and my period is due in 6 days but I just got some spotting today. He didn’t finish in me, in fact he didn’t finish at all.... ahaha. When is the time I should take a pregnancy test?