If you still want to do this (even with lots of people advising you not too). The steps you need to take can be found here How to Move the BizTalk Server Databases (BizTalk 2006R2) The steps you have to do to point to the new Test BizTalk server to your restored databases, which is the step that you've missed out and why it is still pointing to your Production database.
For BizTalk 2010 it would be How to Restore Your Databases and you will also want to read Moving the BizTalk databases (part 2).