Removes outdated test of bookwyrm connector updater

This commit is contained in:
Mouse Reeve 2020-11-25 11:44:19 -08:00
parent 4f6ce0307d
commit 9b79eb5fc3
3 changed files with 2 additions and 27 deletions

View file

@ -24,7 +24,7 @@ class Connector(AbstractConnector):
def is_work_data(self, data):
return data['type'] == 'Work'
return data.get('type') == 'Work'
def get_edition_from_work_data(self, data):

View file

@ -63,29 +63,6 @@ class AbstractConnector(TestCase):
self.assertEqual(mapping.formatter('bb'), 'aabb')
def test_update_from_mappings(self):
data = {
'title': 'Unused title',
'isbn_10': '1234567890',
'isbn_13': 'blahhh',
'blah': 'bip',
'format': 'hardcover',
'series': ['one', 'two'],
}
mappings = [
Mapping('isbn_10'),
Mapping('blah'),# not present on self.book
Mapping('physical_format', remote_field='format'),
Mapping('series', formatter=lambda x: x[0]),
]
book = self.connector.update_from_mappings(self.book, data, mappings)
self.assertEqual(book.title, 'Example Edition')
self.assertEqual(book.isbn_10, '1234567890')
self.assertEqual(book.isbn_13, None)
self.assertEqual(book.physical_format, 'hardcover')
self.assertEqual(book.series, 'one')
def test_match_from_mappings(self):
edition = models.Edition.objects.create(
title='Blah',

View file

@ -28,9 +28,7 @@
],
"lccn": null,
"editions": [
"https://bookwyrm.social/book/5989",
"OL28439584M",
"OL28300471M"
"https://bookwyrm.social/book/5989"
],
"@context": "https://www.w3.org/ns/activitystreams"
}