From 0e1d47961a7c36a40d2eb9596dce39bc50519b2c Mon Sep 17 00:00:00 2001 From: Karolina Przerwa Date: Wed, 12 Apr 2023 13:52:06 +0200 Subject: [PATCH] tests: remove deprecated flask_babelex --- setup.cfg | 2 +- tests/conftest.py | 5 ++--- tests/test_cli.py | 2 -- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/setup.cfg b/setup.cfg index ab923f1..d4467f0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,7 +30,7 @@ install_requires = invenio-admin>=1.2.0 invenio-accounts>=1.4.13 invenio-base>=1.2.11 - invenio-i18n>=1.3.2 + invenio-i18n>=2.0.0 [options.extras_require] tests = diff --git a/tests/conftest.py b/tests/conftest.py index d9a2fe9..610d611 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -14,11 +14,11 @@ import pytest from flask import Flask from flask.cli import ScriptInfo -from flask_babelex import Babel from flask_mail import Mail from flask_principal import ActionNeed, identity_loaded from invenio_accounts import InvenioAccounts from invenio_db import InvenioDB, db +from invenio_i18n import InvenioI18N from sqlalchemy.ext.compiler import compiles from sqlalchemy.schema import DropConstraint, DropSequence, DropTable @@ -56,9 +56,9 @@ def base_app(): SQLALCHEMY_TRACK_MODIFICATIONS=False, TESTING=True, ) - Babel(app_) Mail(app_) InvenioDB(app_) + InvenioI18N(app_) InvenioAccounts(app_) return app_ @@ -70,7 +70,6 @@ def app(base_app, request): db.create_all() def teardown(): - with base_app.app_context(): db.drop_all() identity_loaded.disconnect(load_permissions_on_identity_loaded) diff --git a/tests/test_cli.py b/tests/test_cli.py index 29ad957..a4cec94 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -147,7 +147,6 @@ def role_args(roles): yield role for action, roles in action_roles.items(): - result = runner.invoke( access, ["allow", action] + list(role_args(roles)), @@ -251,7 +250,6 @@ def role_args(roles): # Remove all permissions. # for action, roles in action_roles.items(): - result = runner.invoke( access, ["remove", action] + list(role_args(roles)),