Yes, they can make the contractor take the test: not in the sense of refusing to let him/her leave the premises until taking it, but in the sense that they could say they will fire the contractor or not give him/her any more work unless and until he or she takes the test--making the contractor choose between test and employment is perfectly legal.(One limitation: if there is a written contract with the contractor, which contract is for a definite term and which has not expired yet, and which guarantees work or employment, the employer cannot terminate, suspect, etc. the contractor or deny him/her work in any way which violates the contract. In this case, the employer may have much less leverage to make the contractor take the urine test.)