Skip to content

Commit

Permalink
fix: various test problems
Browse files Browse the repository at this point in the history
* sphinx deprecation warning about wrong intersphinx_mapping usage

* initialize InvenioI18N was missing

* add missing configuration variable
  • Loading branch information
utnapischtim committed Mar 20, 2024
1 parent 0a226d0 commit 000c21f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
"https://docs.python.org/": None,
"python": ("https://docs.python.org/", None),
"invenio-accounts": ("https://invenio-accounts.readthedocs.io/en/latest/", None),
}

Expand Down
13 changes: 7 additions & 6 deletions invenio_oauthclient/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@

from flask import request
from flask_login import user_logged_out
from flask_menu import current_menu
from flask_principal import identity_loaded
from invenio_i18n import LazyString
from invenio_i18n import lazy_gettext as _
from invenio_theme.proxies import current_theme_icons

from . import config, handlers
from .utils import (
Expand Down Expand Up @@ -233,28 +237,25 @@ def override_template_configuration(app):

def init_index_menu(app):
"""Init index menu."""
menu = app.extensions["menu"]

def active_when():
return request.endpoint.startswith("invenio_oauthclient_settings.")

def visible_when():
return bool(app.config.get("OAUTHCLIENT_REMOTE_APPS")) is not False

menu.submenu("settings.oauthclient").register(
current_menu.submenu("settings.oauthclient").register(
"invenio_oauthclient_settings.index",
_(
"%(icon)s Linked accounts",
icon=make_lazy_string(
lambda: f'<i class="{current_theme_icons.link}"></i>'
),
icon=LazyString(lambda: f'<i class="{current_theme_icons.link}"></i>'),
),
order=3,
active_when=active_when,
visible_when=visible_when,
)

menu.submenu("breadcrumbs.settings.oauthclient").register(
current_menu.submenu("breadcrumbs.settings.oauthclient").register(
"invenio_oauthclient_settings.index",
_("Linked accounts"),
)
Expand Down
2 changes: 2 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
# Copyright (C) 2018 University of Chicago.
# Copyright (C) 2023-2024 Graz University of Technology.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
Expand Down Expand Up @@ -140,6 +141,7 @@ def base_app(request):
APP_ALLOWED_HOSTS=["localhost"],
APP_THEME=["semantic-ui"],
THEME_ICONS={"semantic-ui": dict(link="linkify icon")},
OAUTHCLIENT_SETTINGS_TEMPLATE="invenio_oauthclient/settings/base.html",
)
FlaskMenu(base_app)
Babel(base_app)
Expand Down

0 comments on commit 000c21f

Please sign in to comment.