Drop old ignored SAB rows before resync so fixed category parsing can take effect.
14 lines
626 B
Python
14 lines
626 B
Python
from importarr.state import State
|
|
|
|
|
|
def test_delete_queue_items_by_state_can_target_reason(tmp_path):
|
|
state = State(tmp_path / "state.db")
|
|
state.upsert_queue_item(source_type="sab", source_id="stale", name="Stale", state="ignored", reason="SAB category is not owned by Importarr")
|
|
state.upsert_queue_item(source_type="sab", source_id="other", name="Other", state="ignored", reason="other reason")
|
|
|
|
assert state.delete_queue_items_by_state("sab", "ignored", "SAB category is not owned by Importarr") == 1
|
|
|
|
rows = state.list_queue_items()
|
|
assert len(rows) == 1
|
|
assert rows[0]["source_id"] == "other"
|