Merge pull request #77 from Simple2B/svyat/fix/tag

fix title case in tags
This commit is contained in:
Svyatoslav Artymovych 2023-05-26 14:17:46 +03:00 committed by GitHub
commit c5d1f8a65a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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