Praise be to Allah, the Lord of the Worlds; and may His blessings and peace be upon our Prophet Muhammad and upon all his Family and Companions.
Using animals for medical test is permissible if there is some benefit to human beings. But it should be limited to the extent of necessity and should be carried out in a manner that causes the least pain.
The Prophet (Sallallahu Alaihi wa Sallam) said: "Verily, Allah has prescribed al-Ihsan (i.e. performing an action in a perfect manner) towards everything. Thus, if you kill (anyone for some genuine reason), kill (him/her it) humanely; when you slaughter (an animal), slaughter (it) well. And every one of you should sharpen his blade to give rest to the animal he slaughters." [Reported by Imam Muslim]
Allah knows best.