Tesla plans to open a factory to produce battery manufacturing equipment near Toronto in the city of Markham, Ont., Mayor Frank Scarpitti said.