Fix compatibility with python2.6, which does not have assertIsInstance.