You have three issues:
- Can you get it through the security checkpoint in Pearson, or buy it after security in Pearson? If the child is less than 24 months you can bring it through security, and it doesn't need to be in a clear bag either. I think small milk cartons are your best bet - 250 ml, 500 ml, 1 L as you think you need them. At Pearson I'm pretty sure you could buy them after security also, but it might be stressful to look for them. If your child is over 24 months, that will be your only choice however. Don't try to bring a clear 1-quart bag of milk from home, that's going to be awful to deal with on the plane.
- Is it ok to have it on the plane? Yes. But how will you keep it cold? Wouldn't it be better to bring a small amount for in the airport, and let the airline give you more on board as you need it?
- Can you bring it in to SA? That's a good question, and unless you intend to use it all up in flight, one you need to consider. Most places frown on food and agricultural products coming into the country. And depending on how long you're staying, there's no way you can bring enough (unrefrigerated, too) with you to last your whole trip, so you're going to need to figure out how to get milk for the baby while you're there, right?
In your shoes, I would bring 2 250ml cartons, and keep them both sealed until after security. (If you have some sort of toddler issue before security, you can use one and still have the other, then keep an eye out for a chance to buy a replacement.) Use one during the time before you board, and bring one onto the plane. Save it though, and ask for whatever they have on board. If the toddler likes that you're all set, and if not you have your own. Throw out any opened cartons on leaving the plane, before customs. And start looking now into where to get 3.5% (what we call homo or whole milk) there. (The link from MeNoTalk shows a brand and that they call it full-fat. You might want to print that page so as to have the pictures to show hotel staff.)