If you are involved in a contentious child custody or visitation case, you could be ordered to take a drug test. It is most likely to come up in cases where one of the parents has a history of drug abuse or there is a concern about the child's safety. A parent could also file a motion requesting the other parent be drug tested.