Fix the Watched Review Request resource with local sites, and add tests.

The GET handler for the Watched Review Request resource didn't accept
local IDs for review requests, causing it to be pretty useless there.
Now it takes the proper IDs.

Unit tests were added for this, and for all other missing cases.
Fix the Watched Review Request resource with local sites, and add tests.

The GET handler for the Watched Review Request resource didn't accept
local IDs for review requests, causing it to be pretty useless there.
Now it takes the proper IDs.

Unit tests were added for this, and for all other missing cases.
Merge branch 'release-1.6.x' into release-1.7.x
Merge branch 'release-1.7.x'
Added support for authentication against Active Directory subdomains.

This patch enables authentication against specific AD subdomain extracted from
the username. E.g. for configured domain name "example.com" user "north\tom"
will be authenticated as "tom" against "north.example.com".

Testing done:
I have this running fine with multiple AD subdomains configured in my
organization.

Reviewed at https://reviews.reviewboard.org/r/2838/
Update the test suite names for ReviewRequestManager tests.

DbQueryTests had tests named after the old DB query functions we had way
back before introducing ReviewRequestManager. The names and docstrings
were old and outdated. This updates them for the appropriate names,
making it easier to see if they fail, and to introduce new tests.
Update the test suite names for ReviewRequestManager tests.

DbQueryTests had tests named after the old DB query functions we had way
back before introducing ReviewRequestManager. The names and docstrings
were old and outdated. This updates them for the appropriate names,
making it easier to see if they fail, and to introduce new tests.
Merge branch 'release-1.6.x' into release-1.7.x
Extend TestCase to add new fixture and model creation functionality.

Some of TestCase's create_* functions now take additional parameters for
the control of access restrictions and draft management.

It also introduces load_fixtures(), which can be used to add additional
fixtures to a given test.
Merge branch 'release-1.7.x'
Fix the rb-site djblets symlink.

The new Djblets static media support has a new destination for generated
media files. rb-site, though, was still pointing to the old location,
resulting in failed lookups.

We now symlink the proper static location.
Backport the new testing app.

This transitions the new testing app on master to older releases. This
contains utilities for making it easier to write new unit tests without
the need of slow-to-load fixtures, and adds fixture caching.
Filter inaccessible private review requests from queries.

Review requests that were not private to a user would still show up in
the All Review Requests page and in the /api/review-requests/ API. The
query function wasn't taking into account what should have been visible.

Now, ReviewRequest.objects.public() filters out such review requests if
the user cannot see them.

Many unit tests were added to test for these various combinations.
Prevent access to unjoined groups in the dashboard.

In the dashboard, it's possible to construct a URL to show review
requests for groups that you haven't joined. While normally harmless,
this is problematic for private groups, which should not be accessible.

Now, the only valid groups are those that the user is a member of.
All others will result in a 404.
Backport the new testing app.

This transitions the new testing app on master to older releases. This
contains utilities for making it easier to write new unit tests without
the need of slow-to-load fixtures, and adds fixture caching.
Add ExtensionMiddlewareRunner middleware.

This allows extensions to inject middleware. This is useful for things like
authentication methods which need access to the request.

Testing done:
All tests pass:
Ran 746 tests in 68.571s
OK (SKIP=12)

The skipped tests are all related to perforce, which I don't have installed.
They should be unrelated to my patch.

Reviewed at https://reviews.reviewboard.org/r/4563/
Serialize "service" field in /api/hosting-service-accounts/

The service field wasn't being serialized correctly, which meant that if you
tried to use this resource to get a list of things, you'd get a 500 instead.

Testing done:
Connected a GitHub repo, then $ curl /api/hosting-service-accounts/

Reviewed at https://reviews.reviewboard.org/r/4702/
Merge branch 'release-1.7.x'
Strip off #index_header before starting the diff router.

Backbone's router will turn hashes into URL components. This is a problem for
the diff page, which uses #index_header to jump past the review request
details. I've added some code to strip out the hash before we start Backbone's
history tracking, which fixes the URL.

Testing done:
Loaded /diff/#index_header and saw that the URL changed to /diff/# instead of
/diff/index_header.

Reviewed at https://reviews.reviewboard.org/r/4701/
Fix an error in saving profile

This fixes an error in profile saving, because get_or_create returns a tuple
(object, created).

Testing done: Tested that profile saving works.
Reviewed at https://reviews.reviewboard.org/r/4698/