Skip to content

Commit

Permalink
Drop broken label tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jace committed Jan 3, 2024
1 parent 9fbdfa3 commit 8d3a244
Showing 1 changed file with 0 additions and 41 deletions.
41 changes: 0 additions & 41 deletions tests/integration/views/label_views_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

0 comments on commit 8d3a244

Please sign in to comment.