Fix bytes/string mismatch in test on Python 3