Imam al-Shafi'i (may Allah have mercy on him) said: "This is foolishness for which his testimony is rejected, and in the case of a slave-girl it is even worse, because in it there is both foolishness and pandering (diyathah)."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الشهادات / Q21020