Fixed isinstance testcase

Replaced the unicode_or_str hack with the basestring class.

Used assertIsInstance()