Fixes openlibrary connector test

This commit is contained in:
Mouse Reeve 2021-02-03 12:52:13 -08:00
parent 502e235e59
commit 7faf639758
1 changed files with 6 additions and 0 deletions

View File

@ -192,9 +192,15 @@ class Openlibrary(TestCase):
self.assertEqual(edition['key'], '/books/OL9788823M') self.assertEqual(edition['key'], '/books/OL9788823M')
@responses.activate
def test_create_edition_from_data(self): def test_create_edition_from_data(self):
''' okay but can it actually create an edition with proper metadata ''' ''' okay but can it actually create an edition with proper metadata '''
work = models.Work.objects.create(title='Hello') work = models.Work.objects.create(title='Hello')
responses.add(
responses.GET,
'https://openlibrary.org/authors/OL382982A',
json={'hi': 'there'},
status=200)
result = self.connector.create_edition_from_data( result = self.connector.create_edition_from_data(
work, self.edition_data) work, self.edition_data)
self.assertEqual(result.parent_work, work) self.assertEqual(result.parent_work, work)