Skip to content

Commit

Permalink
Undo some unnecessary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun committed Jul 29, 2024
1 parent 0d5cd46 commit 4440e88
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
18 changes: 9 additions & 9 deletions djangocms_versioning/test_utils/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ def get_toolbar(content_obj, user=None, **kwargs):
toolbar.toolbar.set_object(content_obj)
# Set the toolbar mode
if kwargs.get("edit_mode", False):
toolbar.toolbar.__dict__["edit_mode_active"] = True
toolbar.toolbar.__dict__["preview_mode_active"] = False
toolbar.toolbar.__dict__["structure_mode_active"] = False
toolbar.toolbar.edit_mode_active = True
toolbar.toolbar.preview_mode_active = False
toolbar.toolbar.structure_mode_active = False
elif kwargs.get("preview_mode", False):
toolbar.toolbar.__dict__["edit_mode_active"] = False
toolbar.toolbar.__dict__["preview_mode_active"] = True
toolbar.toolbar.__dict__["structure_mode_active"] = False
toolbar.toolbar.edit_mode_active = False
toolbar.toolbar.preview_mode_active = True
toolbar.toolbar.structure_mode_active = False
elif kwargs.get("structure_mode", False):
toolbar.toolbar.__dict__["edit_mode_active"] = False
toolbar.toolbar.__dict__["preview_mode_active"] = False
toolbar.toolbar.__dict__["structure_mode_active"] = True
toolbar.toolbar.edit_mode_active = False
toolbar.toolbar.preview_mode_active = False
toolbar.toolbar.structure_mode_active = True
toolbar.populate()
return toolbar

Expand Down
12 changes: 6 additions & 6 deletions tests/test_menus.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ def _render_menu(self, user=None, **kwargs):
toolbar = CMSToolbar(request)

if kwargs.get("edit_mode", False):
toolbar.__dict__["edit_mode_active"] = True
toolbar.__dict__["preview_mode_active"] = False
toolbar.edit_mode_active = True
toolbar.preview_mode_active = False
elif kwargs.get("preview_mode", False):
toolbar.__dict__["edit_mode_active"] = False
toolbar.__dict__["preview_mode_active"] = True
toolbar.edit_mode_active = False
toolbar.preview_mode_active = True
else:
toolbar.__dict__["edit_mode_active"] = False
toolbar.__dict__["preview_mode_active"] = False
toolbar.edit_mode_active = False
toolbar.preview_mode_active = False

request.toolbar = toolbar
context = {"request": request}
Expand Down

0 comments on commit 4440e88

Please sign in to comment.