Tesla is taking the Ontario government to court over its decision last month to cancel incentives for purchases of electric vehicles.