Ejemplo n.º 1
0
def test_application_root():
    """
    A BASE_DIR setting is mapped to the application_root config parameter.

    Django doesn't have a BASE_DIR setting. However the default project
    template creates it in order to define other settings. As a consequence,
    most Django projets have it.

    """
    base_dir = os.path.dirname(__file__)
    with override_settings(BASE_DIR=base_dir):
        with app_with_scout():
            assert Config().value("application_root") == base_dir
Ejemplo n.º 2
0
def test_on_setting_changed_monitor():
    with app_with_scout(SCOUT_MONITOR=True):
        assert Config().value("monitor") is True
    assert Config().value("monitor") is False
Ejemplo n.º 3
0
def test_on_setting_changed_application_root():
    with app_with_scout(BASE_DIR="/tmp/foobar"):
        assert Config().value("application_root") == "/tmp/foobar"
    assert Config().value("application_root") == ""