made json bytes encoding test work in both python2 and python3