Sort the story list without a leading The, A or An

This commit is contained in:
tim
2026-09-27 23:38:28 +02:00
parent df9959a078
commit ee611cd283
2 changed files with 19 additions and 2 deletions
+8
View File
@@ -47,6 +47,14 @@ def test_list_stories_counts_offsite_and_revised_chapters(tmp_path):
assert story["revised_count"] == 1
def test_list_stories_sorts_titles_without_leading_articles(tmp_path):
store = Store(tmp_path / "db.sqlite")
for n, title in enumerate(["The Zebra", "an Owl", "Anthem", "A Bee", "Theory", "Cat"]):
store.create_story(f"https://example/s/{n}", "example", title, "A", [])
titles = [s["title"] for s in store.list_stories()]
assert titles == ["Anthem", "A Bee", "Cat", "an Owl", "Theory", "The Zebra"]
def test_cover_replaces_previous_cover(tmp_path):
store = Store(tmp_path / "db.sqlite")
sid = store.create_story("u", "s", "T", "A", [])