[FIX] document_page: Broken recomputation lead to invalid history head

This commit is contained in:
Yann Papouin
2023-05-30 09:32:30 +02:00
parent f621268181
commit 9977bdeaa7
2 changed files with 8 additions and 1 deletions

View File

@@ -22,6 +22,10 @@ class TestDocumentPage(common.TransactionCase):
self.assertEqual(len(page.history_ids), 1)
page.content = "New content for Demo Page"
self.assertEqual(len(page.history_ids), 2)
page.content = "Another new content for Demo Page"
self.assertEqual(len(page.history_ids), 3)
# ensure history head is the latest revision (default sort order is ID DESC)
self.assertEqual(page.history_head.id, max(page.history_ids.ids))
def test_category_template(self):
page = self.page_obj.create(