lincolnloop/django-jsonit — pull request #10 by david-wilson (2014-01-11 06:24:17+00:00)
Title: Fixed tests for Python 3.3

Decided to take a stab at fixing this for Python 3.3 (in the process of learning about porting). Tests failed for two reasons:

1. The response.content is a byte array object, so comparison to the string literal fails.
2. With the byte array decoded, the comparison still fails since a specific order is assumed. The encoded object is a dict, which doesn't guarantee any order, and indeed the order varies between 2.7 and 3.3.

I chose to decode the JSON and compare the resulting dicts. This adds complexity to the tests, but seems to me the most robust way of ensuring that the comparison succeeds.