In any custody or visitation proceeding brought under this part, as described in Section 3021, or any guardianship proceeding brought under the Probate Code, the court may order any person who is seeking custody of, or visitation with, a child who is the subject of the proceeding to undergo testing for the illegal use of controlled substances and the use of alcohol if there is a judicial determination based upon a preponderance of evidence that there is the habitual, frequent, or continual illegal use of controlled substances or the habitual or continual abuse of alcohol by the parent, legal custodian, person seeking guardianship, or person seeking visitation in a guardianship. This evidence may include, but may not be limited to, a conviction within the last five years for the illegal use or possession of a controlled substance. The court shall order the least intrusive method of testing for the illegal use of controlled substances or the habitual or continual abuse of alcohol by either or both parents, the legal custodian, person seeking guardianship, or person seeking visitation in a guardianship. If substance abuse testing is ordered by the court, the testing shall be performed in conformance with procedures and standards established by the United States Department of Health and Human Services for drug testing of federal employees. The parent, legal custodian, person seeking guardianship, or person seeking visitation in a guardianship who has undergone drug testing shall have the right to a hearing, if requested, to challenge a positive test result. A positive test result, even if challenged and upheld, shall not, by itself, constitute grounds for an adverse custody or guardianship decision. Determining the best interests of the child requires weighing all relevant factors. The court shall also consider any reports provided to the court pursuant to the Probate Code. The results of this testing shall be confidential, shall be maintained as a sealed record in the court file, and may not be released to any person except the court, the parties, their attorneys, the Judicial Council, until completion of its authorized study of the testing process, and any person to whom the court expressly grants access by written order made with prior notice to all parties. Any person who has access to the test results may not disseminate copies or disclose information about the test results to any person other than a person who is authorized to receive the test results pursuant to this section. Any breach of the confidentiality of the test results shall be punishable by civil sanctions not to exceed two thousand five hundred dollars ($2,500). The results of the testing may not be used for any purpose, including any criminal, civil, or administrative proceeding, except to assist the court in determining, for purposes of the proceeding, the best interest of the child pursuant to Section 3011 and the content of the order or judgment determining custody or visitation. The court may order either party, or both parties, to pay the costs of the drug or alcohol testing ordered pursuant to this section. As used in this section, "controlled substances" has the same meaning as defined in the California Uniform Controlled Substances Act (Division 10 (commencing with Section 11000) of the Health and Safety Code).
Ca. Fam. Code § 3041.5