From e9a20e618ff67b2c3bac6fd4e2b51df693841dd6 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Wed, 27 Nov 2019 12:19:20 +0000 Subject: [PATCH] Add fields to with_content_json --- wagtail/core/models.py | 2 ++ wagtail/core/tests/test_page_model.py | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/wagtail/core/models.py b/wagtail/core/models.py index 13341e8c6..68750448e 100644 --- a/wagtail/core/models.py +++ b/wagtail/core/models.py @@ -1524,6 +1524,8 @@ class Page(AbstractPage, index.Indexed, ClusterableModel, metaclass=PageBase): obj.has_unpublished_changes = self.has_unpublished_changes obj.owner = self.owner obj.locked = self.locked + obj.locked_by = self.locked_by + obj.locked_at = self.locked_at obj.latest_revision_created_at = self.latest_revision_created_at obj.first_published_at = self.first_published_at diff --git a/wagtail/core/tests/test_page_model.py b/wagtail/core/tests/test_page_model.py index 1d5ee522d..28c9c9db1 100644 --- a/wagtail/core/tests/test_page_model.py +++ b/wagtail/core/tests/test_page_model.py @@ -1632,7 +1632,9 @@ class TestPageWithContentJSON(TestCase): first_published_at="2000-01-01T00:00:00Z", last_published_at="2000-01-01T00:00:00Z", live=not original_page.live, - locked=not original_page.locked, + locked=True, + locked_by=1, + locked_at="2000-01-01T00:00:00Z", has_unpublished_changes=not original_page.has_unpublished_changes, content_type=eventpage_content_type.id, show_in_menus=not original_page.show_in_menus, @@ -1655,7 +1657,7 @@ class TestPageWithContentJSON(TestCase): # despite new values being provided in content_json for attr_name in ( 'pk', 'path', 'depth', 'numchild', 'content_type', 'draft_title', - 'live', 'has_unpublished_changes', 'owner', 'locked', + 'live', 'has_unpublished_changes', 'owner', 'locked', 'locked_by', 'locked_at', 'latest_revision_created_at', 'first_published_at', ): self.assertEqual(