Fix tests for python3

Some dirty hack here by my mind. But its works.