Jesus became like us in every way (Heb 2:17). He suffered when he was tempted. He had the power to withstand the temptation, but that doesn't mean it was easy. Was he also tempted during his 40-day fast? Probably, but not so directly. Maybe that was one reason he went to the desert: because there was no food there and he could not avoid fasting. James talks about perseverance finishing its work "so that you may be mature and complete." Yet most often we think that we should be able to simply pray and have God sweep away whatever desire tempts us--and if He doesn't, then we assume the desire is not really a temptation. At least, that's the mistake I have made over and over.
Jesus didn't give up his deity; but somehow he laid it aside so that he could become "one of us." But it was always there, and I wonder if part of his private suffering was from knowing that he could not express fully who he was.