def METHOD_NAME(oauth2_settings, rf, settings, oidc_only_view, caplog):
    assert oauth2_settings.OIDC_ENABLED is False
    settings.DEBUG = False
    with caplog.at_level(logging.WARNING, logger="oauth2_provider"):
        rsp = oidc_only_view(rf.get("/"))
    assert rsp.status_code == 404
    assert len(caplog.records) == 1
    assert "OIDC views are not enabled" in caplog.records[0].message