Some of it depends. The three main criteria for post-accident testing are:
Human Fatality
Bodily injury with immediate medical treatment away from scene
Disabling damage to any motor vehicle requiring tow away
In the first case,
Human Fatality, a post-accident test must be performed by the carrier on the driver(s) whether a citation is issued or not.
In the second and third cases, a post-accident test is required if the driver was cited, but is not required if the driver was not cited.
So, for example, you could be driving through an intersection and someone else runs a red light, t-boning you, and one or more vehicles need to be towed. You would not be required to have a post-accident drug test unless you were cited for somehow causing the accident (which is unlikely). However, if the driver who t-boned you died in the accident, you would still be required to take a test.
The gory details and a nifty little table for all this can be
found here.