use re.escape

This commit is contained in:
Adeodato Simó 2024-04-09 19:18:02 -03:00
parent 8733369605
commit 4304cd4a79
No known key found for this signature in database
GPG key ID: 98EF291323013F6E

View file

@ -359,7 +359,8 @@ class Status(TestCase):
)
activity = status.to_activity(pure=True)
if pages:
expect_re = f'^<p>"my quote"</p> <p>— <a .+</a>, {pages}</p>$'
pages_re = re.escape(pages)
expect_re = f'^<p>"my quote"</p> <p>— <a .+</a>, {pages_re}</p>$'
else:
expect_re = '^<p>"my quote"</p> <p>— <a .+</a></p>$'
self.assertRegex(activity["content"], expect_re)