Merge branch 'master' of github.com:Gluejar/regluit into tastypie2
commit
51f87eb824
|
@ -20,6 +20,8 @@ def gluejar_search(q):
|
|||
r['author'] = v['authors'][0]
|
||||
else:
|
||||
r['author'] = ""
|
||||
r['isbn_10'] = None
|
||||
r['isbn_13'] = None
|
||||
|
||||
# pull out isbns
|
||||
for i in v.get('industryIdentifiers', []):
|
||||
|
|
|
@ -49,17 +49,12 @@ class SearchTests(TestCase):
|
|||
self.assertEqual(len(results), 10)
|
||||
|
||||
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('description'))
|
||||
self.assertTrue(r.has_key('image'))
|
||||
self.assertTrue(r.has_key('publisher'))
|
||||
self.assertTrue(r.has_key('identifier'))
|
||||
|
||||
for r in results:
|
||||
for i in r['identifier']:
|
||||
self.assertTrue(i.has_key('name'))
|
||||
self.assertTrue(i.has_key('value'))
|
||||
self.assertTrue(r.has_key('isbn_10'))
|
||||
|
||||
def test_googlebooks_search(self):
|
||||
response = search.googlebooks_search('melville')
|
||||
|
|
Loading…
Reference in New Issue