Load admin site for Unit Tests, add form tests

Review Request #1572 — Created Feb. 26, 2019 and updated

guest9376
Review Board
72e4c83...
54
The admin site models and URLs were unable to be accessed during Unit
Tests. This meant that if a test attempted to access an admin model
page, the page would respond with a 404 error.

Adding django.contrib.admin.autodiscover() during initial test setup
loads all the admin UI models, so tests have access to admin URLS.

DefaultReviewer form tests, WebhookTargetAdmin form tests, and
OauthAdmin form tests were all added as well, to check that forms
function as expected.

Testing Done:
Running ./tests/runtests.py returns no errors. The form tests added
pass.

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


Loading...