@contextmanager
def local_settings(**kwargs):
    original_values = []
    for key, value in kwargs.items():
        original_values.append([key, getattr(settings, key)])
        setattr(settings, key, value)
    try:
        yield
    finally:
        for key, value in original_values:
            setattr(settings, key, value)
See :func:`burpui.misc.backend.interface.BUIbackend.get_tree`
dataset/ETHPy150Open frankban/django-endless-pagination/endless_pagination/tests/test_models.py/local_settings--crossover with--dataset/ETHPy150Open ziirish/burp-ui/burpui/misc/backend/burp2.py/Burp.get_tree