Fix failing tests in other machines and Python 3.x

- Use Python 3.x PyBytes_FromString instead of PyString_FromString.
- Don't use assertIsNone (not available in 2.6)
- Do not suppose the tuple order is fixed across machines.