From df78cc64a661a73e0e7cbafa9cac90d3d1f6b4e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adeodato=20Sim=C3=B3?= Date: Mon, 8 Apr 2024 16:10:00 -0300 Subject: [PATCH] Quotation._format_position: do not treat page numbers as integers Fixes: #3352 --- bookwyrm/models/status.py | 2 +- bookwyrm/tests/models/test_status_model.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/bookwyrm/models/status.py b/bookwyrm/models/status.py index 546a8d6c8..dc0ab45a6 100644 --- a/bookwyrm/models/status.py +++ b/bookwyrm/models/status.py @@ -395,7 +395,7 @@ class Quotation(BookStatus): end = self.endposition or 0 if self.position_mode != "PG" or not beg: return None - return f"pp. {beg}-{end}" if end > beg else f"p. {beg}" + return f"pp. {beg}-{end}" if end else f"p. {beg}" @property def pure_content(self): diff --git a/bookwyrm/tests/models/test_status_model.py b/bookwyrm/tests/models/test_status_model.py index b2ca63854..5a7f0429b 100644 --- a/bookwyrm/tests/models/test_status_model.py +++ b/bookwyrm/tests/models/test_status_model.py @@ -1,5 +1,4 @@ """ testing models """ -from unittest import expectedFailure from unittest.mock import patch import pathlib import re @@ -338,7 +337,6 @@ class Status(TestCase): activity["attachment"][0]["name"], "Author Name: Test Edition (worm)" ) - @expectedFailure def test_quotation_page_serialization(self, *_): """serialization of quotation page position""" tests = [