Fix test breakages on Python 3 due to assumptions on dictionary order.

Review Request #9729 — Created March 4, 2018 and submitted — Latest diff uploaded

Information

Djblets
release-2.0.x
ac6732d...

Reviewers

We had a number of unit tests that assumed results from a dictionary
would be in a particular order, which was only valid in Python 2.x.
Dictionary order has changed on 3.x, and looks to change again in 3.7.

For the purposes of testing, some of the dictionaries we defined in test
suites now use OrderedDict, and in other cases we're now comparing
against a set of values.

OAuth2 scope generation had a few changes as well. We no longer store
HTTP methods as a set (which wasn't needed and wasn't worth it), and
instead store as a list and sort when outputting into a string.

Relevant unit tests pass on Python 2.7, 3.4, 3.5, and 3.6.