Will God test people? Why does God test people?

Are you a Catholic? I remember in the Bible and in the Book of James, it is mentioned that believers should be patient and tempted. The following are verses from the teleological Bible.

1:2 My brothers, when you fall into various temptations, consider it a great joy.

1:3 Because you know that patience comes from the test of faith.

1:4 but this persistence must be carried out perfectly, so that you are perfect, complete and lack nothing.

1: 12 Blessed is the man who endures temptation, because since he can stand it, he will get the crown of life that the Lord promised to those who love him.