Can I test after 2 weeks of sex ??

Can I take a pregnancy test 2 weeks after having sex or will it show false results??

I had sex on the 21st, it’s been like 2 weeks, but I’ve been cramping a lot and one day I was spotting but it was light pink. I wasn’t worried cause I thought it had been period spotting since I had just gotten off my period a few days before i had sex but for the last week I’ve been cramping and my lower back hurts and I just feel like I’m about to have my period but my period isn’t due for another 2 week. And also first my friend asked if I was pregnant and now today my mom told me she had a dream I was pregnant, which kinda got me worried for some reason.

Also I was on BC pills but I stopped them a few days before my period but I did take plan b a few hours after sex.