Fix test on Python 2.7