Skip to content

Commit

Permalink
fix text error for MenuItemAdminVersionLocked, because locked_by is n…
Browse files Browse the repository at this point in the history
…ot passed through.
  • Loading branch information
FreemanPancake committed Oct 29, 2024
1 parent 31577f9 commit ed2237a
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down

0 comments on commit ed2237a

Please sign in to comment.