SubscribeStar .art age fix, modal tag-flow sync, system tags / training hygiene (#128) #190

Merged
bvandeusen merged 9 commits from dev into main 2026-07-03 09:16:16 -04:00
2 changed files with 18 additions and 7 deletions
Showing only changes of commit 65bd1c22c3 - Show all commits
+3 -1
View File
@@ -660,8 +660,10 @@ async def test_reset_content_tagging_apply_requires_confirm_token(client, db):
for bad in ({"dry_run": False}, {"dry_run": False, "confirm": "deadbeef"}):
resp = await client.post("/api/admin/tags/reset-content", json=bad)
assert resp.status_code == 400
# Non-system only: the seeded hygiene tags (#128) survive a reset by
# design, so they'd inflate a whole-table count.
remaining = (await db.execute(
select(func.count()).select_from(Tag)
select(func.count()).select_from(Tag).where(Tag.is_system.is_(False))
)).scalar_one()
assert remaining == 1
+15 -6
View File
@@ -377,8 +377,11 @@ def test_prune_unused_tags_dry_run_returns_count_and_names(db_sync, tmp_path):
assert result["count"] == 2
assert "prune-me-1" in result["sample_names"]
assert "prune-me-2" in result["sample_names"]
# Nothing actually deleted.
surviving = db_sync.execute(select(func.count(Tag.id))).scalar_one()
# Nothing actually deleted. Non-system only — the seeded hygiene tags
# (#128) are exempt from pruning and would inflate a whole-table count.
surviving = db_sync.execute(
select(func.count(Tag.id)).where(Tag.is_system.is_(False))
).scalar_one()
assert surviving == 3
@@ -499,8 +502,11 @@ def test_reset_content_tagging_dry_run_counts_without_deleting(db_sync, tmp_path
assert result["count"] == 2
assert result["by_kind"] == {"general": 1, "character": 1}
assert result["applications"] == 2
# Nothing deleted — all 4 tags still present.
assert db_sync.execute(select(func.count(Tag.id))).scalar_one() == 4
# Nothing deleted — all 4 fixture tags still present (non-system count;
# the seeded hygiene tags #128 also survive, by design).
assert db_sync.execute(
select(func.count(Tag.id)).where(Tag.is_system.is_(False))
).scalar_one() == 4
def test_reset_content_tagging_deletes_content_keeps_fandom_series(db_sync, tmp_path):
@@ -525,8 +531,11 @@ def test_reset_content_tagging_deletes_content_keeps_fandom_series(db_sync, tmp_
result = cleanup_service.reset_content_tagging(db_sync, dry_run=False)
assert result["deleted"] == 2
# general + character gone; fandom + series kept.
kinds = db_sync.execute(select(Tag.kind)).scalars().all()
# general + character gone; fandom + series kept. Non-system only — the
# seeded hygiene tags (#128, kind=general) survive a reset by design.
kinds = db_sync.execute(
select(Tag.kind).where(Tag.is_system.is_(False))
).scalars().all()
kind_vals = {k.value if hasattr(k, "value") else str(k) for k in kinds}
assert kind_vals == {"fandom", "series"}
# series_page ordering survived.