forked from mirrors/bookwyrm
Merge branch 'main' into production
This commit is contained in:
commit
b36cf5a7b8
2 changed files with 4 additions and 1 deletions
|
@ -63,7 +63,7 @@ class Book(ActivitypubMixin, BookWyrmModel):
|
|||
def edition_info(self):
|
||||
''' properties of this edition, as a string '''
|
||||
items = [
|
||||
self.physical_format,
|
||||
self.physical_format if hasattr(self, 'physical_format') else None,
|
||||
self.languages[0] + ' language' if self.languages and \
|
||||
self.languages[0] != 'English' else None,
|
||||
str(self.published_date.year) if self.published_date else None,
|
||||
|
|
|
@ -473,11 +473,14 @@ class Incoming(TestCase):
|
|||
'data/fr_edition.json')
|
||||
bookdata = json.loads(datafile.read_bytes())
|
||||
|
||||
models.Work.objects.create(
|
||||
title='Test Work', remote_id='https://bookwyrm.social/book/5988')
|
||||
book = models.Edition.objects.create(
|
||||
title='Test Book', remote_id='https://bookwyrm.social/book/5989')
|
||||
|
||||
del bookdata['authors']
|
||||
self.assertEqual(book.title, 'Test Book')
|
||||
|
||||
with patch(
|
||||
'bookwyrm.activitypub.base_activity.set_related_field.delay'):
|
||||
incoming.handle_update_edition({'object': bookdata})
|
||||
|
|
Loading…
Reference in a new issue