They wouldn't. If I were to bother to bring a case to court to claim YOU for example were the dad. Well magistrate would be happy enough to grant the test because without it how do they know how to proceed?
If you were in a different country at the time of conception that would work, or have a specialist doctor's report showing you have been infertile since birth.