Regroup copies when a board or search is switched off, and fold the duplicates plan into the decisions
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e1c197b488
commit
82b7902eff
4 files changed
+34
-65
No files matched your search
@@ -175,3 +175,21 @@ def test_a_v17_file_gains_dup_of_with_its_first_rebuild(tmp_path: Path) -> None:
|
||||
with sqlite3.connect(path) as conn:
|
||||
assert conn.execute("SELECT 1 FROM sqlite_master WHERE name = 'idx_roles_dup_of'"
|
||||
).fetchone() is not None
|
||||
|
||||
|
||||
def test_switching_a_board_off_shows_its_roles_copies_at_once(store: Store) -> None:
|
||||
"""A close outside a pull regroups too: the search's copy of a role whose
|
||||
board is switched off is listed again without waiting for a pull."""
|
||||
from app.jobs.sources import set_fetch
|
||||
sub = store.add_subscription("ats", "teamtailor:trackunit", label="Trackunit")
|
||||
board = role("board", company="Trackunit", title="Backend Engineer", place="Aalborg",
|
||||
board="teamtailor")
|
||||
search = role("search", company="Trackunit", title="Backend Engineer",
|
||||
place="Aalborg, Denmark", board=None, provider="jobindex")
|
||||
store.upsert_role(board, sub)
|
||||
store.upsert_role(search)
|
||||
store.rebuild_dupes()
|
||||
assert dup_of(store)[search.uid] == board.uid
|
||||
|
||||
set_fetch(store, sub.id, False)
|
||||
assert dup_of(store) == {board.uid: None, search.uid: None}
|
||||
Reference in new issue
Block a user