All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
The person who takes a ritual bath (i.e., Ghusl) from sexual impurity, etc. is not required to pronounce the testimony of faith. As far as we know, no scholar said that it is obligatory to do so. However, some jurists are of the opinion that it is recommended for the person who takes a bath to say the same supplication that is said after making ablution. In his Al-Insaaf, Al-Mirdaawi Al-Hanbali, may Allaah have mercy upon him, said in the chapter on Al-Wudoo’ Wa Sifatuhu, “Then he raises his sight to the heaven and says, 'I bear witness that there is no god worthy to be worshipped but Allah, and I bear witness that Muhammad is His Slave and Messenger.'" In his Al-Faa’eq, he mentions that (it is recommended) to say it (i.e. this supplication) after taking a ritual bath.”
As far as the reason behind this recommendation is concerned, some scholars believe that Ghusl includes ablution and other additional acts. Besides, it is advisable for the person when making a recommended Ghusl to perform ablution before it, maintaining that this is by means of recommendation, not an obligation. As such, whoever takes a bath and does not pronounce the testimony of faith afterward, his Ghusl is correct.
Allah knows best.