Joseph refuses to be seduced by the governor's wife 12:23-37
12:23 And she, in whose house he (Joseph) was, sought to seduce him and closed the doors saying, 'Come!' 'In Allah is my refuge!' he replied. 'My Lord has made my dwelling a good one. Harm doers never prosper.'
12:24 She desired him, had he not been shown the proof of his Lord he would have taken her. But We turned him away from evil and abomination, for he was one of Our sincere worshipers.
12:25 They raced to the door and she tore his shirt from behind. And by the door, they met her husband whereupon she said, 'What is the recompense of one whose intent is evil against your people other than being imprisoned, or sternly punished!'
12:26 He (Joseph) said, 'It was she who sought to seduce me,' and a witness (an infant) of her people bore witness, saying, 'If his shirt is torn from the front, she is speaking the truth and he is one of the liars,