Chapter XIII. The Contradictions of the Scriptures Intended to Try Those Who Read Them
And Peter answered: “If the Scriptures or prophets speak of gods, they do so to try those who hear. For thus it is written: 'If there arise among you a prophet, giving signs and wonders, and that sign and wonder shall then come to pass, and he say to you, Let us go after and worship other gods which your fathers have not known, ye shall not hearken to the words of that prophet; let your hands be among the first to stone him. For he has tried to turn you from the Lord your God.
But if you say in your heart, How did he do that sign or wonder? You shall surely know that he who tried you, tried you to see if you fear the Lord your God.' The words 'he who tried you, tried you,' have reference to the earliest times; but it appears to be otherwise after the removal to Babylon. For God, who knows all things, would not, as can be proved by many arguments, try in order that He Himself might know, for He fore-knows all things. But, if you like, let us discuss this point, and I shall show that God foreknows.
But it has been proved that the opinion is false that He does not know, and that this was written to try us. Thus we, Simon, can be led astray neither by the Scriptures nor by any one else; nor are we deceived into the admission of many gods, nor do we agree to any statement that is made against God.”
Source: Clementine Homilies (New Advent)