From d024d44b79d63b1c3e990e4243f5df348d7624e4 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Thu, 17 Dec 2020 13:46:32 -0800 Subject: [PATCH 1/2] Fixes incoming tests --- bookwyrm/tests/test_incoming.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bookwyrm/tests/test_incoming.py b/bookwyrm/tests/test_incoming.py index a317ef714..22f1521be 100644 --- a/bookwyrm/tests/test_incoming.py +++ b/bookwyrm/tests/test_incoming.py @@ -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}) From 6149f36c7fa659b9d62f6e1e737f2a729517622d Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Thu, 17 Dec 2020 13:55:31 -0800 Subject: [PATCH 2/2] Fixes bug in alt text breaing serializing work --- bookwyrm/models/book.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bookwyrm/models/book.py b/bookwyrm/models/book.py index a6b2774d1..5dece504b 100644 --- a/bookwyrm/models/book.py +++ b/bookwyrm/models/book.py @@ -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,