fix unittest AttributeError (Python 2.6)