Okay, this brings another question from me: does your civilization actually need to possess the required resources of the upgraded unit, or can you just upgrade your unit if a trading partner has the resource but is not trading it with you?
I'm guessing along the lines of the former, since it does not make since that trading partners, even civilizations with a permanent alliance, would just give away a resource because they allow you to come through their borders.