The purpose of temptation is to entice a person to sin by breaking God's laws and commandments. Testing occurs when God brings events into someone's life in order to reveal their character. He may also allow, from other sources, events or even enticements to sin in order to accomplish his ultimate goals and purposes.
The book of James teaches us that temptation, unlike testing, will NEVER come directly from God. The Godhead has and always will be perfect in love (Malachi 3:6, James 1:17, Hebrews 13:8). Satan's selfish philosophy of life, centered on competition and strife, will never appeal to them.
Do not let anyone who is tempted say, "I am being tempted by God" because God is not tempted by evil, and He Himself tempts no one with evil (James 1:13, HBFV).
Temptation is primarily based on deception. This is why a fallen Lucifer, the universe's first sinner and chief promoter of disobedience, is called the "Father of lies" (John 8:44). His hardness against the Godhead and dogmatic belief in the superiority of his own thoughts caused him to commit spiritual suicide.
Satan led Eve, in the Garden of Eden, into disbelieving God by both lying to her and appealing to human nature's desire for power (Genesis 3:1 - 5, 2Corinthians 11:3). Lucifer tempted King David to sin by leading him to trust in his own strength and number his army. The deceiver was also allowed to provide regular temptation to Christ not just before his public ministry began (Matthew 4, Luke 22:28), but also throughout his earthly life (Hebrews 2:18, 4:15).
Though warned not to do so, Lot's wife gave in to the temptation of seeing her home in Sodom destroyed. The penalty for indulging herself was immediate (Genesis 19:17, 26). King David brought manifold troubles to his own house when he indulged his lust for a beautiful woman named Bathsheba (2Samuel 11 - 12). Those who actively pursue great riches not only bring temptation to themselves, they also open themselves up to indulging in a host of other hurtful lusts (1Timothy 6:9).
God directly tested Abraham by commanding he sacrifice his son Isaac in order to determine if he would be fully obedient to his word. Abraham's passing of the test proved he was worthy to not only be the father of countless generations but also to have them bless the entire world (Genesis 22:16 - 18)! God also tested ancient Israel for FORTY years, while they wandered the desert before entering the promised land, in order to determine their level of obedience (Deuteronomy 8:1 - 2).
With a basic understanding of the difference between temptation and testing, we can better comprehend one otherwise unclear scripture. What is commonly referred to as "the Lord's prayer" has a statement in it that, on the surface, seems to ask God not to tempt us. It was given by Jesus when he stated, "And lead us not into temptation, but deliver us from evil . . ." (Luke 11:4, KJV, see also Matthew 6:13).
As stated previously, the Eternal will never lead or entice anyone to sin. This verse means we should pray that our Father not allow the devil to entice us into disobedience but rather save us from his evil powers.
Whether it comes from the devil or arises out of our own desires, the goal of temptation is always to lead us to sin. God will never directly lead us into any disobedience. That said, he can use the enticements to sin brought by other sources (Daniel 12: 9 - 10) as a means of testing, refining and perfecting a person's character.
Christians can take great comfort in knowing, whatever does come their way, that their heavenly Father promises to preserve them in and through it (1Corinthians 10:13, Romans 8:28).