Add test helpers for creating review request drafts and HTTP requests.
Review Request #10710 — Created Sept. 10, 2019 and submitted
Many of the unit tests in our codebase involve creating an
and setting state on it (like users, a
LocalSite, or a
ResolverMatch), which is done through a
requires a lot of annoying, repeated code.
We also often need to create a
ReviewRequestDraft, which is easier,
but still requires more setup than is generally required for our other
This change introduces new helpers for both.
takes care of constructing the
HttpRequestfrom the factory and
setting various properties on it. Down the road, this could be updated
to provide more capabilities like running middleware.
create_review_request_draft()is a simple wrapper around
ReviewRequestDraft.create(), which lets unit tests avoid the extra
A few unit tests have been updated to use
ensure that everything works as expected.
Unit tests pass.
Made use of these new helpers in upcoming unit tests.