In James 1:13 God says he will not tempt anyone with evil. But compare with Jeremiah 35:2-5. If drinking wine (other than for medicinal purposes) is a sin, why did God tell the prophet to bring wine into the house of the Lord and tell the people to drink it?
Sin is the breaking of God's commands. "Everyone who practices sin also practices lawlessness; and sin is lawlessness" (I John 3:4). Thus, God will not tempt people to act against Him. But this does not mean that God will not test people. "Consider it all joy, my brethren, when you encounter various trials, knowing that the testing of your faith produces endurance. And let endurance have its perfect result, so that you may be perfect and complete, lacking in nothing" (James 1:2-4).
Therefore, while God finds human sacrifice abhorrent (Leviticus 18:21), He still commanded Abraham to sacrifice his son as a test of Abraham's faith. God had no intentions of allowing Abraham to actually sacrifice his son, but God wanted to demonstrate the strength of Abraham's obedience. "He said, "Do not stretch out your hand against the lad, and do nothing to him; for now I know that you fear God, since you have not withheld your son, your only son, from Me"" (Genesis 22:12).
In the same way, God knew about the command of Jonadab to his descendants. He also knew the strength of their commitment to their father's words. God knew that they would turn his prophet down and it became a good counterpoint to Israel's disobedience.
""Go to the house of the Rechabites and speak to them, and bring them into the house of the LORD, into one of the chambers, and give them wine to drink."
Then I took Jaazaniah the son of Jeremiah, son of Habazziniah, and his brothers and all his sons and the whole house of the Rechabites, and I brought them into the house of the LORD, into the chamber of the sons of Hanan the son of Igdaliah, the man of God, which was near the chamber of the officials, which was above the chamber of Maaseiah the son of Shallum, the doorkeeper. Then I set before the men of the house of the Rechabites pitchers full of wine and cups; and I said to them, "Drink wine!"
But they said, "We will not drink wine, for Jonadab the son of Rechab, our father, commanded us, saying, 'You shall not drink wine, you or your sons, forever. You shall not build a house, and you shall not sow seed and you shall not plant a vineyard or own one; but in tents you shall dwell all your days, that you may live many days in the land where you sojourn.' We have obeyed the voice of Jonadab the son of Rechab, our father, in all that he commanded us, not to drink wine all our days, we, our wives, our sons or our daughters, nor to build ourselves houses to dwell in; and we do not have vineyard or field or seed. We have only dwelt in tents, and have obeyed and have done according to all that Jonadab our father commanded us. But when Nebuchadnezzar king of Babylon came up against the land, we said, 'Come and let us go to Jerusalem before the army of the Chaldeans and before the army of the Arameans.' So we have dwelt in Jerusalem."
Then the word of the LORD came to Jeremiah, saying, "Thus says the LORD of hosts, the God of Israel, 'Go and say to the men of Judah and the inhabitants of Jerusalem, "Will you not receive instruction by listening to My words?" declares the LORD. "The words of Jonadab the son of Rechab, which he commanded his sons not to drink wine, are observed. So they do not drink wine to this day, for they have obeyed their father's command. But I have spoken to you again and again; yet you have not listened to Me. Also I have sent to you all My servants the prophets, sending them again and again, saying: 'Turn now every man from his evil way and amend your deeds, and do not go after other gods to worship them. Then you will dwell in the land which I have given to you and to your forefathers; but you have not inclined your ear or listened to Me. Indeed, the sons of Jonadab the son of Rechab have observed the command of their father which he commanded them, but this people has not listened to Me'"'" (Jeremiah 35:2-16).
Notice that the Rechabites don't just not drink alcohol, they don't plant vineyards or drink grape juice either. In fact, the word in Hebrew is yayin. This word refers to any product of grapes from fresh juice to preserved juice to alcoholic juice. The point being made would have been made even if the yayin offered was grape juice because the Rechabites would have turned it down. It was both a demonstration and a test of their commitment to their covenant.
Peter also was given a test. God commanded him to eat animals which were unclean under the Old Law. "But he became hungry and was desiring to eat; but while they were making preparations, he fell into a trance; and he saw the sky opened up, and an object like a great sheet coming down, lowered by four corners to the ground, and there were in it all kinds of four-footed animals and crawling creatures of the earth and birds of the air. A voice came to him, "Get up, Peter, kill and eat!" But Peter said, "By no means, Lord, for I have never eaten anything unholy and unclean"" (Acts 10:10-14). Three times Peter turned down God's command. Here God was trying to get Peter to realize that the Law had changed. What was unclean was no longer unclean. It took a while for that lesson to settle into Peter's mind.