Add a TestCase utility function for overriding siteconfig settings.

Review Request #9941 — Created May 15, 2018 and submitted — Latest diff uploaded

Information

Djblets
release-1.0.x
f4fd611...

Reviewers

This adds TestCase.siteconfig_settings, a context manager that
overrides the site configuration settings for a test or part of a test.

The base implementation will store new settings in siteconfig and then
revert them after the context manager is finished. It does not apply any
settings to Django by default, though, leaving this up to a more
specific implementation.

This is largely pulled from a utility method in Review Board.

Made use of this in upcoming changes. Verified the new siteconfig settings
and that they were reverted after the change.

    Loading...