adjusted test to expect the title and isbns in the new location
parent
d653277da6
commit
53ceeb800c
|
@ -20,6 +20,8 @@ def gluejar_search(q):
|
||||||
r['author'] = v['authors'][0]
|
r['author'] = v['authors'][0]
|
||||||
else:
|
else:
|
||||||
r['author'] = ""
|
r['author'] = ""
|
||||||
|
r['isbn_10'] = None
|
||||||
|
r['isbn_13'] = None
|
||||||
|
|
||||||
# pull out isbns
|
# pull out isbns
|
||||||
for i in v.get('industryIdentifiers', []):
|
for i in v.get('industryIdentifiers', []):
|
||||||
|
|
|
@ -49,17 +49,12 @@ class SearchTests(TestCase):
|
||||||
self.assertEqual(len(results), 10)
|
self.assertEqual(len(results), 10)
|
||||||
|
|
||||||
r = results[0]
|
r = results[0]
|
||||||
self.assertTrue(r.has_key('name'))
|
self.assertTrue(r.has_key('title'))
|
||||||
self.assertTrue(r.has_key('author'))
|
self.assertTrue(r.has_key('author'))
|
||||||
self.assertTrue(r.has_key('description'))
|
self.assertTrue(r.has_key('description'))
|
||||||
self.assertTrue(r.has_key('image'))
|
self.assertTrue(r.has_key('image'))
|
||||||
self.assertTrue(r.has_key('publisher'))
|
self.assertTrue(r.has_key('publisher'))
|
||||||
self.assertTrue(r.has_key('identifier'))
|
self.assertTrue(r.has_key('isbn_10'))
|
||||||
|
|
||||||
for r in results:
|
|
||||||
for i in r['identifier']:
|
|
||||||
self.assertTrue(i.has_key('name'))
|
|
||||||
self.assertTrue(i.has_key('value'))
|
|
||||||
|
|
||||||
def test_googlebooks_search(self):
|
def test_googlebooks_search(self):
|
||||||
response = search.googlebooks_search('melville')
|
response = search.googlebooks_search('melville')
|
||||||
|
|
Loading…
Reference in New Issue