This general cluster of questions does come up a good bit with all of us, at one point or another. So this needs to be carefully addressed.
I would like to look at James 1:12-14, which covers the issue of whether and how God tempts / tests us quite well.
12 Blessed is the man who endures temptation; for when he has been approved, he will receive the crown of life which the Lord has promised to those who love Him. 13 Let no one say when he is tempted, “I am tempted by God”; for God cannot be tempted by evil, nor does He Himself tempt anyone. 14 But each one is tempted when he is drawn away by his own desires and enticed.