Fix test for unicode so that it works in both py2 and py3