From ed2237aa15a0630672c89d61514dfdd592232ec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=82=85=E7=9D=BF=E6=9B=BC?= Date: Tue, 29 Oct 2024 16:17:55 +0800 Subject: [PATCH] fix text error for MenuItemAdminVersionLocked, because locked_by is not passed through. --- tests/test_admin.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/test_admin.py b/tests/test_admin.py index 12faa1d57..084a4281f 100644 --- a/tests/test_admin.py +++ b/tests/test_admin.py @@ -376,7 +376,15 @@ def test_get_changelist_template_preview(self): class MenuItemAdminVersionLocked(CMSTestCase, UsefulAssertsMixin): def setUp(self): - self.menu_content = factories.MenuContentWithVersionFactory(version__state=DRAFT) + self.author_user = factories.UserFactory(is_staff=True) + menu_edit_creation_param = { + "version__state": DRAFT, + } + if CMS_41: + menu_edit_creation_param.update({ + "version__locked_by": self.author_user, + }) + self.menu_content = factories.MenuContentWithVersionFactory(**menu_edit_creation_param) self.item = factories.ChildMenuItemFactory(parent=self.menu_content.root) self.change_url = reverse( @@ -386,7 +394,12 @@ def setUp(self): self.client.force_login(self.get_superuser()) # moving a node - menu_content = factories.MenuContentWithVersionFactory() + menu_move_creation_param = {} + if CMS_41: + menu_move_creation_param.update({ + "version__locked_by": self.author_user, + }) + menu_content = factories.MenuContentWithVersionFactory(**menu_move_creation_param) self.child = factories.ChildMenuItemFactory(parent=menu_content.root) self.child_of_child = factories.ChildMenuItemFactory(parent=self.child) self.move_url = reverse(