The law about drug testing is constantly changing but essentially it can be discrimination if they treat you differently because they believe you have a substance abuse issue unless this treatment is reasonable.
It is clear that they have a strong obligation to keep the workplace safe and requiring all employees to be free for the influence of drugs is not going to be considered unlawful.
But the can only test if the testing goes to your ability and not just to whether you have consumed a drug. And they cannot have a system that provides for automatic discipline if you are found to have a used a drug when the test is done.
They also cannot decide you have a substance abuse problem just because you have been seen to have used drugs.
On the other hand they are doing this because there was an incident and courts find that this approach has merit.
They will have to prove that this testing is necessary to ensure safety in the workplace.
So whether the testing will be allowed will depend on these various factors. But if you are saying that you only consumed these drugs on your off time and that even if they are still in your blood they are not longer affecting your ability and can prove that they could not discipline you if the results of the test show drug use.
I am sure your union has a policy about how to handle this and knows the law and there may even be something in your collective agreement that covers this.
Does this help at a starting point.
Please feel free to post back with any follow-up questions you may have. If you don't have any then I hope I have earned a 5 star rating but if you don't feel that I have please don't hesitate to reply back and let me know what more I can do to assist you. Finally, please know that even after you rate me I will be here for you and you can ask follow-up questions if you think of them later on at no further charge of course.