diff --git a/tests/integration/views/label_views_test.py b/tests/integration/views/label_views_test.py index a00c27831..e4f4553b8 100644 --- a/tests/integration/views/label_views_test.py +++ b/tests/integration/views/label_views_test.py @@ -3,7 +3,6 @@ import pytest from flask import Flask from flask.testing import FlaskClient -from sqlalchemy.orm import scoped_session from funnel import models @@ -40,43 +39,3 @@ def test_edit_option_label_view( resp = client.post(opt_label.url_for('edit'), follow_redirects=True) assert "Manage labels" in resp.data.decode('utf-8') assert "Only main labels can be edited" in resp.data.decode('utf-8') - - -@pytest.mark.xfail(reason="Broken after Flask-SQLAlchemy 3.0, unclear why") # FIXME -def test_main_label_delete( - db_session: scoped_session, - client: FlaskClient, - login: LoginFixtureProtocol, - new_user: models.User, - new_label: models.Label, -) -> None: - login.as_(new_user) - resp = client.post(new_label.url_for('delete'), follow_redirects=True) - assert "Manage labels" in resp.data.decode('utf-8') - assert "The label has been deleted" in resp.data.decode('utf-8') - label = db_session.get(models.Label, new_label.id) - assert label is None - - -@pytest.mark.xfail(reason="Broken after Flask-SQLAlchemy 3.0, unclear why") # FIXME -def test_optioned_label_delete( - db_session: scoped_session, - client: FlaskClient, - login: LoginFixtureProtocol, - new_user: models.User, - new_main_label: models.Label, -) -> None: - login.as_(new_user) - label_a1 = new_main_label.options[0] - label_a2 = new_main_label.options[1] - - # let's delete the main optioned label - resp = client.post(new_main_label.url_for('delete'), follow_redirects=True) - assert "Manage labels" in resp.data.decode('utf-8') - assert "The label has been deleted" in resp.data.decode('utf-8') - mlabel = db_session.get(models.Label, new_main_label.id) - assert mlabel is None - - # so the option labels should have been deleted as well - for olabel in [label_a1, label_a2]: - assert models.Label.query.get(olabel.id) is None