The stems, leaves and roots, though the question did not say tomato plant. The reason it is poisonous is because, in it’s unripe stages, the fruit is poisonous.
The word "its" is misspelled in the explanation about tomatoes. The question about "tomatoes" is not a good one. People don't eat unripe tomatoes or tomato foliage. To be fair, perhaps the question could ask about tomato plants, rather than "tomatoes." Further complicating matters is the historical fact that Europeans regarded tomatoes with suspicion when tomatoes were first brought across the Atlantic. People thought the fruits were poisonous. This question is like the ones that a certain professor Novak, known as "Doctor No," used to slip into his biology examinations, to make sure nobody got a perfect score. One time he torched a cuttlefish until there was nothing left except a small pile of ashes. The students were given two minutes to identify the specimen during a lab practical. Such questions could be called "trick questions," if one were inclined to charity.