Fix unit tests on Python <= 2.6