mirror of
https://github.com/logos-co/open-law.git
synced 2025-01-25 06:10:12 +00:00
fix title case in tags
This commit is contained in:
parent
3ef9346466
commit
c370e2508a
@ -25,7 +25,7 @@ def set_book_tags(book: m.Book, tags: str):
|
|||||||
for book_tag in book_tags:
|
for book_tag in book_tags:
|
||||||
db.session.delete(book_tag)
|
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:
|
for tag_name in tags_names:
|
||||||
try:
|
try:
|
||||||
|
@ -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()
|
book = m.Book.query.filter_by(label=BOOK_NAME).first()
|
||||||
assert book.tags
|
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
|
assert len(book.tags) == 3
|
||||||
for tag in book.tags:
|
for tag in book.tags:
|
||||||
tag: m.Tag
|
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()
|
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
|
assert len(book.tags) == 3
|
||||||
for tag in book.tags:
|
for tag in book.tags:
|
||||||
tag: m.Tag
|
tag: m.Tag
|
||||||
|
Loading…
x
Reference in New Issue
Block a user