Skip to content

Commit

Permalink
config: ensuring that the setting of ACCOUNTS_REGISTER_BLUEPRINT=Fals…
Browse files Browse the repository at this point in the history
…e works
  • Loading branch information
psaiz committed Dec 20, 2023
1 parent 04d5171 commit 84f47f9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions invenio_accounts/views/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def init_menu():
# Register root breadcrumbs
item = current_menu.submenu("breadcrumbs.settings")
item.register("invenio_userprofiles.profile", _("Account"))
if not current_app.config.get("ACCOUNTS_REGISTER_BLUEPRINT"):
return

# - Register menu
# - Change password
Expand Down
13 changes: 13 additions & 0 deletions tests/test_invenio_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,19 @@ def test_init_rest():
assert "security" in app.blueprints.keys()
assert "security_email_templates" in app.blueprints.keys()

app = Flask("testapp")
app.config["ACCOUNTS_REGISTER_BLUEPRINT"] = False
Babel(app)
Mail(app)
InvenioDB(app)
ext = InvenioAccountsREST()
assert "invenio-accounts" not in app.extensions
assert "security" not in app.blueprints.keys()
ext.init_app(app)
assert "invenio-accounts" in app.extensions
assert "security" in app.blueprints.keys()
assert "security_email_templates" in app.blueprints.keys()


@pytest.mark.skip(reason="Mergepoint is on invenio-access.")
def test_alembic(app):
Expand Down

0 comments on commit 84f47f9

Please sign in to comment.