forked from mirrors/bookwyrm
add test with valid isbn10
This commit is contained in:
parent
5801ef011f
commit
a4b08d7213
1 changed files with 14 additions and 0 deletions
|
@ -28,6 +28,7 @@ class BookSearch(TestCase):
|
|||
openlibrary_key="hello",
|
||||
)
|
||||
|
||||
# isbn13 entry
|
||||
self.third_edition = models.Edition.objects.create(
|
||||
title="Python Testing",
|
||||
parent_work=self.work,
|
||||
|
@ -36,6 +37,15 @@ class BookSearch(TestCase):
|
|||
published_date=datetime.datetime(2017, 9, 1, 0, 0, tzinfo=timezone.utc),
|
||||
)
|
||||
|
||||
# isbn10 entry
|
||||
self.fourth_edition = models.Edition.objects.create(
|
||||
title="Pride and Prejudice: Jane Austen",
|
||||
parent_work=self.work,
|
||||
isbn_13="190962165X",
|
||||
physical_format="Paperback",
|
||||
published_date=datetime.datetime(2017, 9, 1, 0, 0, tzinfo=timezone.utc),
|
||||
)
|
||||
|
||||
def test_search(self):
|
||||
"""search for a book in the db"""
|
||||
# title/author
|
||||
|
@ -56,6 +66,10 @@ class BookSearch(TestCase):
|
|||
self.assertEqual(len(results), 1)
|
||||
self.assertEqual(results[0], self.third_edition)
|
||||
|
||||
results = book_search.search("1-9096-2165-X")
|
||||
self.assertEqual(len(results), 1)
|
||||
self.assertEqual(results[0], self.fourth_edition)
|
||||
|
||||
# identifier
|
||||
results = book_search.search("hello")
|
||||
self.assertEqual(len(results), 1)
|
||||
|
|
Loading…
Reference in a new issue