Allow override_feature_check(s) to be used as decorators.
Review Request #14601 — Created Sept. 9, 2025 and submitted
override_feature_check
andoverride_feature_checks
are two handy
methods that allow enabling or disabling features for unit testing.
Until now, they've been implemented solely as context managers. This
meant adding an additional layer of indentation for tests that needed to
wrap everything inside of them.This change rewrites these two as classes which inherit from
django.test.utils.TestContextDecorator
. This allows these to be used
either as a context manager or as a decorator.
- Ran unit tests.
- Used these in decorator form elsewhere.