fix title case in tags

This commit is contained in:
SvyatoslavArtymovych 2023-05-26 14:10:14 +03:00
parent 3ef9346466
commit c370e2508a
2 changed files with 3 additions and 3 deletions

View File

@ -25,7 +25,7 @@ def set_book_tags(book: m.Book, tags: str):
for book_tag in book_tags:
db.session.delete(book_tag)
tags_names = [tag.title() for tag in tags.split(",") if len(tag)]
tags_names = [tag.lower() for tag in tags.split(",") if len(tag)]
for tag_name in tags_names:
try:

View File

@ -23,7 +23,7 @@ def test_create_tags_on_book_create_and_edit(client: FlaskClient):
book = m.Book.query.filter_by(label=BOOK_NAME).first()
assert book.tags
splitted_tags = [tag.title() for tag in tags.split(",")]
splitted_tags = [tag.lower() for tag in tags.split(",")]
assert len(book.tags) == 3
for tag in book.tags:
tag: m.Tag
@ -42,7 +42,7 @@ def test_create_tags_on_book_create_and_edit(client: FlaskClient):
book: m.Book = m.Book.query.first()
splitted_tags = [tag.title() for tag in tags.split(",")]
splitted_tags = [tag.lower() for tag in tags.split(",")]
assert len(book.tags) == 3
for tag in book.tags:
tag: m.Tag