A paternity test uses DNA, normally from blood samples, to determine whether the presumed father is the biological father.

DNA testing is much cheaper than previous blood-type testing, costing $600.00 to $800.00. It can be completed more quickly, normally in a few days.The accuracy of DNA testing is normally more than 99%.

A person, usually through his lawyer, can apply to the court for leave to obtain blood tests for the use of determining paternity, and to submit the results into evidence. Generally, a court will grant leave for blood tests if parentage is an issue in the case. However, the granting of leave is not automatic, and will not be allowed if the court believes that a person is using the paternity testing to delay matters.

If a person is unwilling to submit to the court-ordered blood tests, he cannot be found in contempt of court. However, if a person refuses to undergo blood testing, a court is entitled to drawn an adverse inference from this.
There have been several constitutional challenges to the laws allowing the courts to order blood tests. However, all of them have failed. The courts have found that ordering blood tests does not violate a person’s privacy rights; a person’s rights to life, liberty and security of the person; a person’s right to security from unreasonable search and seizure; and a person’s right not to be subjected to cruel and unusual punishment. This is because the court does not compel a person to submit to blood tests; rather the court only draws an adverse inference on a person’s failure to do so.

If the paternity test reveals that the person is not the father, then that person will not be required to pay child support.

There are limits to when a court will use paternity testing:
Access - A court generally will not admit the results of a paternity test when it is deciding access because what is important is not whether that person is the father. What matters is what is in the best interest of the child. A parent and child relationship already exists - Another situation where a court will not look at the results of paternity testing is where a parent and child relationship already exists even if the “father” is not the biological father. This is because for child support purposes, it does not matter whether the person is the biological father.  https://www.ontario.ca/laws/statute/90c12#BK5
A 1998 Supreme Court of Canada judgement ruled that a step-parent could be required to pay child support if he acted as a parent for long enough.

Author - Earl Sands, Canadian Law