Add documents feature
This commit is contained in:
parent
23b6ce62a3
commit
422411f12e
18 changed files with 1521 additions and 216 deletions
|
|
@ -61,8 +61,10 @@ def test_dates_with_content_and_search(fresh_db):
|
|||
assert _today() in dates and _yesterday() in dates and _tomorrow() in dates
|
||||
|
||||
hits = list(fresh_db.search_entries("alpha"))
|
||||
assert any(d == _today() for d, _ in hits)
|
||||
assert any(d == _tomorrow() for d, _ in hits)
|
||||
# search_entries now returns (kind, key, title, text, aux)
|
||||
page_dates = [key for (kind, key, _title, _text, _aux) in hits if kind == "page"]
|
||||
assert _today() in page_dates
|
||||
assert _tomorrow() in page_dates
|
||||
|
||||
|
||||
def test_get_all_entries_and_export(fresh_db, tmp_path):
|
||||
|
|
|
|||
|
|
@ -33,7 +33,10 @@ def test_open_selected_with_data(qtbot, fresh_db):
|
|||
it = QListWidgetItem("dummy")
|
||||
from PySide6.QtCore import Qt
|
||||
|
||||
it.setData(Qt.ItemDataRole.UserRole, "1999-12-31")
|
||||
it.setData(
|
||||
Qt.ItemDataRole.UserRole,
|
||||
{"kind": "page", "date": "1999-12-31"},
|
||||
)
|
||||
s.results.addItem(it)
|
||||
s._open_selected(it)
|
||||
assert seen == ["1999-12-31"]
|
||||
|
|
@ -95,6 +98,6 @@ def test_populate_results_shows_both_ellipses(qtbot, fresh_db):
|
|||
qtbot.addWidget(s)
|
||||
s.show()
|
||||
long = "X" * 40 + "alpha" + "Y" * 40
|
||||
rows = [("2000-01-01", long)]
|
||||
rows = [("page", "2000-01-01", "2000-01-01", long, None)]
|
||||
s._populate_results("alpha", rows)
|
||||
assert s.results.count() >= 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue