Use assertIsInstance instead of assertTrue with isInstance.