Fix display_id usage in the trophy box.

The trophy box was using the review request's display_id to compute whether to
display, but was using id for the text displayed on the page.

Fixes bug 3037.
Add back a parameter for Bitbucket unit tests.

The expected_http_called parameter accidentally got removed from the
wrong class's function. It was meant to be removed from Beanstalk, not
Bitbucket.
Fix the RepositoryForm unit tests, and make them less error-prone.

My final work for the Bitbucket support broke RepositoryForm unit tests,
and I apparently failed to test those. So, this change fixes it, by
making use of a TestService instead of using an existing hosting service
for tests. This way, we can control things like authorization (which is
what broke the tests before), repository checking, fields, etc.
Fix PEP-8 issues with some more code.

This addresses problems in the attachments, changedescs, cmdline, and
diffviewer modules.

Reviewed at https://reviews.reviewboard.org/r/4424/
Merge branch 'release-1.7.x'