mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-10-31 22:19:00 +00:00
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):
|
def edition_info(self):
|
||||||
''' properties of this edition, as a string '''
|
''' properties of this edition, as a string '''
|
||||||
items = [
|
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] + ' language' if self.languages and \
|
||||||
self.languages[0] != 'English' else None,
|
self.languages[0] != 'English' else None,
|
||||||
str(self.published_date.year) if self.published_date else None,
|
str(self.published_date.year) if self.published_date else None,
|
||||||
|
|
|
@ -473,11 +473,14 @@ class Incoming(TestCase):
|
||||||
'data/fr_edition.json')
|
'data/fr_edition.json')
|
||||||
bookdata = json.loads(datafile.read_bytes())
|
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(
|
book = models.Edition.objects.create(
|
||||||
title='Test Book', remote_id='https://bookwyrm.social/book/5989')
|
title='Test Book', remote_id='https://bookwyrm.social/book/5989')
|
||||||
|
|
||||||
del bookdata['authors']
|
del bookdata['authors']
|
||||||
self.assertEqual(book.title, 'Test Book')
|
self.assertEqual(book.title, 'Test Book')
|
||||||
|
|
||||||
with patch(
|
with patch(
|
||||||
'bookwyrm.activitypub.base_activity.set_related_field.delay'):
|
'bookwyrm.activitypub.base_activity.set_related_field.delay'):
|
||||||
incoming.handle_update_edition({'object': bookdata})
|
incoming.handle_update_edition({'object': bookdata})
|
||||||
|
|
Loading…
Reference in a new issue