Allah surely tests us only to our capabilities. Temptations to sin are also within the nature of mankind who is the creation of Allah and the power to overcome it has been bestowed by Allah, but this is potentially there and when temptations come on the way, this power of resistance and controlling the vicious self is actualized and man resembles the angles or even attains a higher status near Allah because of reaching perfection in a manner that the angles cannot due to their possessing the faculty of intellect only and not having to combat with the desire and anger.
Man has to overcome their extra faculties of desire and anger and make their intellect rule these faculties which help in sinning and temptations if they loose their equilibrium by not using it in their appropriate manner.
The test is great but so is the reward. In the Quran it mentions that
"Indeed, successful is the one who has purified himself."
This purification is to balance the faculties and let the intellect rule the faculty of desire and anger.
You can read.more on this by searching on the perfect man in Islam and books like these mainly found in Al islam.org library.