How long after sex do I have to wait to take a test?

Me and my boyfriend had sex last night. We started off with a condom but halfway through he took it off. This morning he sent me a text asking me to take a test. But I know taking a test the next day won't be accurate. My last period was about 1-2 weeks ago. How long do I have to wait to take a pregnancy test? Also, can pre cum get you pregnant?