Help please....

So my period is super irregular like I can go months without it. I had sex without protection so when should I take a pregnancy test?