The period immediately after birth is one of the most dangerous times for children, and we (should) specifically take action to protect them in a moment where they are at risk and have no agency. A paternity test would increase the risk of harm to the child (either through violence, deprivation, or neglect). We didn't even get to the subject of possible violence against the mother either, which is likely.