Exemple #1
0
def test_fresh_context():
    assert settings.SHOULDBEFRESHINCONTEXT == "first"
    environ["DYNACONF_SHOULDBEFRESHINCONTEXT"] = "second"
    assert settings.SHOULDBEFRESHINCONTEXT == "first"
    with settings.fresh():
        assert settings.get("DOTENV_INT") == 1
        assert settings.SHOULDBEFRESHINCONTEXT == "second"
def test_fresh_context():
    assert settings.SHOULDBEFRESHINCONTEXT == 'first'
    os.environ['DYNACONF_SHOULDBEFRESHINCONTEXT'] = 'second'
    assert settings.SHOULDBEFRESHINCONTEXT == 'first'
    with settings.fresh():
        assert settings.get("DOTENV_INT") == 1
        assert settings.SHOULDBEFRESHINCONTEXT == 'second'