From 80a1180090cd23f7629dd261a7fe9c63e477661d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adeodato=20Sim=C3=B3?= ", ' "', self.quote)
quote = re.sub(r"
{citation}
{self.content}" diff --git a/bookwyrm/tests/models/test_status_model.py b/bookwyrm/tests/models/test_status_model.py index 760849f28..d1f07b44e 100644 --- a/bookwyrm/tests/models/test_status_model.py +++ b/bookwyrm/tests/models/test_status_model.py @@ -314,6 +314,29 @@ class Status(TestCase): ) self.assertEqual(activity["attachment"][0]["name"], "Test Edition") + def test_quotation_with_author_to_pure_activity(self, *_): + """serialization of quotation of a book with author and edition info""" + self.book.authors.set([models.Author.objects.create(name="Author Name")]) + self.book.physical_format = "worm" + self.book.save() + status = models.Quotation.objects.create( + quote="quote", + content="", + user=self.local_user, + book=self.book, + ) + activity = status.to_activity(pure=True) + self.assertEqual( + activity["content"], + ( + f'quote— Author Name: ' + "Test Edition
" + ), + ) + self.assertEqual( + activity["attachment"][0]["name"], "Author Name: Test Edition (worm)" + ) + def test_quotation_page_serialization(self, *_): """serialization of quotation page position""" tests = [