fix(schema): do nothing when there is no series

This commit is contained in:
Steppenstreuner
2026-08-28 18:21:53 +02:00
parent d992e8fd97
commit 6eaab5bc5d
2 changed files with 17 additions and 2 deletions
+13
View File
@@ -31,3 +31,16 @@ def test_comic_template():
def test_first_author_only():
r = req(title="X", authors="Alice A, Bob B")
assert render_template("{Author}", r) == "Alice A"
def test_empty_series_level_is_dropped():
r = req(title="Der Ickabog", authors="J.K. Rowling")
assert render_template("{Author}/{Series}/{Title} ({Narrator})", r) == "J.K. Rowling/Der Ickabog"
def test_series_level_kept_when_set():
r = req(title="Harry Potter und der Feuerkelch", authors="J.K. Rowling",
series="Harry Potter")
r.narrator = "Rufus Beck"
assert render_template("{Author}/{Series}/{Title} ({Narrator})", r) == \
"J.K. Rowling/Harry Potter/Harry Potter und der Feuerkelch (Rufus Beck)"