Quotation._format_position: do not treat page numbers as integers

Fixes: #3352
This commit is contained in:
Adeodato Simó 2024-04-08 16:10:00 -03:00
parent f844abcad9
commit df78cc64a6
No known key found for this signature in database
GPG key ID: 98EF291323013F6E
2 changed files with 1 additions and 3 deletions

View file

@ -395,7 +395,7 @@ class Quotation(BookStatus):
end = self.endposition or 0 end = self.endposition or 0
if self.position_mode != "PG" or not beg: if self.position_mode != "PG" or not beg:
return None 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 @property
def pure_content(self): def pure_content(self):

View file

@ -1,5 +1,4 @@
""" testing models """ """ testing models """
from unittest import expectedFailure
from unittest.mock import patch from unittest.mock import patch
import pathlib import pathlib
import re import re
@ -338,7 +337,6 @@ class Status(TestCase):
activity["attachment"][0]["name"], "Author Name: Test Edition (worm)" activity["attachment"][0]["name"], "Author Name: Test Edition (worm)"
) )
@expectedFailure
def test_quotation_page_serialization(self, *_): def test_quotation_page_serialization(self, *_):
"""serialization of quotation page position""" """serialization of quotation page position"""
tests = [ tests = [