Skip to content

Commit

Permalink
Filter wtforms 3.1 iter_groups warning
Browse files Browse the repository at this point in the history
  • Loading branch information
cjmayo committed Jul 21, 2024
1 parent 9651712 commit 20e6563
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
11 changes: 10 additions & 1 deletion flask_admin/tests/sqla/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@ def fill_db(db, Model1, Model2):
db.session.commit()


@pytest.mark.filterwarnings("ignore:Please update your type formatter:UserWarning")
@pytest.mark.filterwarnings(
"ignore:'iter_groups' is expected to return 4 items tuple since wtforms 3.1, this will be mandatory in wtforms 3.2:DeprecationWarning",
"ignore:Please update your type formatter:UserWarning",
)
def test_model(app, db, admin):
with app.app_context():
Model1, Model2 = create_models(db)
Expand Down Expand Up @@ -2120,6 +2123,9 @@ def test_default_complex_sort(app, db, admin):
assert data[1].model1.test1 == 'b'


@pytest.mark.filterwarnings(
"ignore:'iter_groups' is expected to return 4 items tuple since wtforms 3.1, this will be mandatory in wtforms 3.2:DeprecationWarning",
)
def test_extra_fields(app, db, admin):
with app.app_context():
Model1, _ = create_models(db)
Expand Down Expand Up @@ -2186,6 +2192,9 @@ def test_extra_field_order(app, db, admin):
('zh_TW', '首頁'),
)
)
@pytest.mark.filterwarnings(
"ignore:'iter_groups' is expected to return 4 items tuple since wtforms 3.1, this will be mandatory in wtforms 3.2:DeprecationWarning",
)
@flask_babel_test_decorator
def test_modelview_localization(request, app, locale, expect_text):
# We need to configure the default Babel locale _before_ the `babel` fixture is
Expand Down
8 changes: 7 additions & 1 deletion flask_admin/tests/sqla/test_form_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ def test_rule_field_set(app, db, admin):
assert pos3 == -1


@pytest.mark.filterwarnings("ignore:Fields missing:UserWarning")
@pytest.mark.filterwarnings(
"ignore:'iter_groups' is expected to return 4 items tuple since wtforms 3.1, this will be mandatory in wtforms 3.2:DeprecationWarning",
"ignore:Please update your type formatter:UserWarning",
)
def test_rule_inlinefieldlist(app, db, admin):
with app.app_context():
Model1, Model2 = create_models(db)
Expand All @@ -140,6 +143,9 @@ def test_rule_inlinefieldlist(app, db, admin):
assert rv.status_code == 200


@pytest.mark.filterwarnings(
"ignore:'iter_groups' is expected to return 4 items tuple since wtforms 3.1, this will be mandatory in wtforms 3.2:DeprecationWarning",
)
def test_inline_model_rules(app, db, admin):
with app.app_context():
Model1, Model2 = create_models(db)
Expand Down

0 comments on commit 20e6563

Please sign in to comment.