mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-27 20:11:14 +00:00
Adds return_first tests to book_search
This commit is contained in:
parent
8612cf654d
commit
77ee1147d5
1 changed files with 12 additions and 0 deletions
|
@ -57,12 +57,24 @@ class BookSearch(TestCase):
|
|||
self.assertEqual(len(results), 1)
|
||||
self.assertEqual(results[0], self.second_edition)
|
||||
|
||||
def test_search_identifiers_return_first(self):
|
||||
"""search by unique identifiers"""
|
||||
result = book_search.search_identifiers("hello", return_first=True)
|
||||
self.assertEqual(result, self.second_edition)
|
||||
|
||||
def test_search_title_author(self):
|
||||
"""search by unique identifiers"""
|
||||
results = book_search.search_title_author("Another", min_confidence=0)
|
||||
self.assertEqual(len(results), 1)
|
||||
self.assertEqual(results[0], self.second_edition)
|
||||
|
||||
def test_search_title_author_return_first(self):
|
||||
"""search by unique identifiers"""
|
||||
results = book_search.search_title_author(
|
||||
"Another", min_confidence=0, return_first=True
|
||||
)
|
||||
self.assertEqual(results, self.second_edition)
|
||||
|
||||
def test_format_search_result(self):
|
||||
"""format a search result"""
|
||||
result = book_search.format_search_result(self.first_edition)
|
||||
|
|
Loading…
Reference in a new issue