There's a test that can be done in the womb I think, but it's just too risky in my opinion.
Why not wait and just get the mouth swab done and prepare financially and mentally if it is your child?
Also, hopefully you'll remember to wear a condom next time.
There was a show on Maury kinda like this though.
This woman had one boyfriend, broke up with him, and soon after had another one. Then, she ended up pregnant. Luckily, it was with the later boyfriend but both men wanted to take responsibility.
Good luck!