In cases of child custody and visitation rights, divorce, legal separation, and other legal situations where the rights and duties of a father are involved, establishing paternity becomes a big issue, to say the least.
There are a number of different ways to legally establish paternity in California, and most of these do not require any genetic test. First, there is the Voluntary Declaration of Paternity (VDP) form, which both mother and father sign at the hospital when an unmarried woman gives birth. If the couple is married, the husband of the mother is assumed the father unless there is reason to think otherwise.
Even without being the biological father, it is possible for a couple living together, and where the man demonstrates commitment to a caring relationship with the child, that he would be considered "father" for certain legal purposes. And in California today, people can be "designated" as "father" by the state, if that role is assigned to one member of a same-sex couple by the couple itself.
Finally, if paternity actions go to court to establish who the father is, these can be pursued by the mother who wishes to establish or deny a particular male is father, by an alleged father who wants to prove/disprove he is father, by an orphanage or adoption agency, or by a state child protective or child support agency.