Rewrite to avoid assertIsNone, assertIsNotNone for Python 2.6.