Add a new base TestCase class with helpful factory methods.

This introduces a new reviewboard.testing app with a new base TestCase
class that's intended to be used in other tests. This class provides a
handful of methods for creating various models we use in tests, along
with default data (which can be overridden by the callers).

This will allow us to reduce our dependence on most fixtures, which will
speed up tests, and make tests more readable.
Move away from most fixtures on all non-webapi apps.

This removes the usage of the test_reviewrequests and most of the
test_scmtools fixtures from the non-webapi unit tests. Instead, these
test suites now use the new TestCase class's utility methods for
creating test objects.

With the test suite as it originally was, on my machine, it took roughly
159 seconds to complete. With this change, it's down to ~143. After my
upcoming change, which also removes data from the test_scmtools fixture,
the time drops to ~88.
Move away from most fixtures for the webapi tests.

This removes the usage of the test_reviewrequests and most of the
test_scmtools fixtures from the webapi unit tests. Instead, these test
suites now use the new TestCase class's utility methods for creating
test objects.

It also removes a lot of the older utility methods for creating dummy
objects that went through the API. Each of these requests contributed
50-100ms of time, which added up.

With the test suite as it originally was, on my machine, it took roughly
159 seconds to complete. After this and the previous changes, it drops
to around ~88.

Unit tests are much clearer now. Instead of having to know how fixtures
are set up, or tracing through a bunch of API requests, you can just
read the unit tests and see what they're doing.

In total, 1,834 lines of code have been deleted in these changes.
Fix error output when setting a FileAttachment's thumbnail.

The error output was returning a string, which didn't match all other
cases of INVALID_FORM_DATA errors. It should be returning an array.
Fix up several fields in the admin UI for models.

While adding some entries to the docs database for the diff file
attachments, I realized we had some missing fields in the admin UI and
some fields that should have been limited to raw IDs. The file
attachment fields on ReviewRequest weren't exposed at all.

This change adds the missing fields and marks up a few to require raw
IDs.

Also, some fields weren't allowed to be blank, even though they should
have been.
Improve the output of the API docs.

The API docs need a lot of work, and this is one step in that direction.

We now longer show sample XML payloads. While they work, it's preferable
that people just use JSON, so advertise that instead. This has the
benefit of lengthening some very large API doc pages.

The examples now have a sample curl command line for getting the
resource. It also shows the headers that come back.

The description of the resource is now at the top, before the other
details (like URL, child resources, etc.)

Some bullet points have been removed where they just added clutter.

There are some fixes for table layouts. Mostly, this is dealing with
adding CSS classes, which will work with stylesheet changes for the RB
website.
Remove the trailing blank line in markdown text.

The markup() function returns a string with an extra blank line (as
every HTML tag is outputted with a trailing newline). We don't really
want this, since it leaves a blank line in each <pre>, so check if
there's a newline and strip it away. This brings the look to how we had
things pre-markdown.
Include sample extension entries in the docs database.

Sample extension entries were missing from the docs database, causing a
failure to build on the server. This wasn't noticed locally, due to them
being imported during the docs run.
Render the diff change index from JS instead of Django.

The new change index was about half template half javascript--we'd render the
basic table with each of the files from a django template, and then as diffs
were loaded, update it.

This change moves the initial render into the javascript as well. The data is
plumbed into javascript by passing it into the DiffViewerPageView. This change
is one step towards being able to update the displayed diff (revision/page/etc)
without reloading everything.

Testing done:
* Viewed a handful of diff revisions and interdiffs. Saw the table as before in
  each case.
* Ran js-tests
* Ran jshint

Reviewed at https://reviews.reviewboard.org/r/4545/
Load diff files from javascript.

This changes the diff viewer to create the diff-container items from javascript
instead of the django template.

Testing done:
* Loaded a few different diff revisions and interdiffs and saw that things
  loaded correctly.
* Ran js-tests.
* Ran jshint.

Reviewed at https://reviews.reviewboard.org/r/4546/
Make the "Diff Revision" label dynamically rendered in javascript.

In order to be able to update the displayed revision, this content needs to be
generated on the client side instead of the server.

Testing done:
* Viewed various revisions of a diff, including interdiffs. Saw the expected
  text each time.
* Checked that the "latest diff" and "See what's changed" links worked
  correctly.
* Ran js-tests.
* Ran jshint.

Reviewed at https://reviews.reviewboard.org/r/4555/
Pre-compile fixtures for unit tests.

Django's fixture support is extraordinarily inefficient. For every
single unit test, it does the following:

* Recalculates the list of possible fixture directories
* Locates each fixture file within those directories
* Tries to figure out how to deserialize them
* Deserializes them
* Saves them

That's done per-test. Most of those operations are things that could be
easily cached, including the deserialized fixture content.

Our TestCase rewrites fixture loading to do just this. When we see a new
fixture, we precompile it, getting the list of objects and storing it.
We then use that precompiled version whenever the fixture is requested
for future tests.

This saves 10 seconds on the test suite.
Change django.conf.urls.defaults -> django.conf.urls

Django 1.4 changed the namespace for 'patterns' and 'url' from
django.conf.urls.defaults to django.conf.urls. This was listed in the
deprecation notes, but we never updated it because 1.4 maintained
compatibility. 1.5 got rid of the compatibility shim, so we need to actually
update now.

Testing done: Ran unit tests

Reviewed at https://reviews.reviewboard.org/r/4566/