mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-27 03:51:08 +00:00
add wonky ISBN test
This commit is contained in:
parent
18d3d2f85d
commit
68d91086ed
1 changed files with 12 additions and 0 deletions
|
@ -28,6 +28,12 @@ class BookSearch(TestCase):
|
|||
openlibrary_key="hello",
|
||||
)
|
||||
|
||||
self.third_edition = models.Edition.objects.create(
|
||||
title="Edition with annoying ISBN",
|
||||
parent_work=self.work,
|
||||
isbn_10="022222222X",
|
||||
)
|
||||
|
||||
def test_search(self):
|
||||
"""search for a book in the db"""
|
||||
# title/author
|
||||
|
@ -57,6 +63,12 @@ class BookSearch(TestCase):
|
|||
self.assertEqual(len(results), 1)
|
||||
self.assertEqual(results[0], self.second_edition)
|
||||
|
||||
def test_search_identifiers_isbn_search(self):
|
||||
"""search by unique ID with slightly wonky ISBN"""
|
||||
results = book_search.search_identifiers("22222222x")
|
||||
self.assertEqual(len(results), 1)
|
||||
self.assertEqual(results[0], self.third_edition)
|
||||
|
||||
def test_search_identifiers_return_first(self):
|
||||
"""search by unique identifiers"""
|
||||
result = book_search.search_identifiers("hello", return_first=True)
|
||||
|
|
Loading…
Reference in a new issue