From 4440e887494074da40471c6be4536c0edc7eb289 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Mon, 29 Jul 2024 18:06:50 +0200 Subject: [PATCH] Undo some unnecessary changes --- .../test_utils/test_helpers.py | 18 +++++++++--------- tests/test_menus.py | 12 ++++++------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/djangocms_versioning/test_utils/test_helpers.py b/djangocms_versioning/test_utils/test_helpers.py index 3c6e40d1..51db206f 100644 --- a/djangocms_versioning/test_utils/test_helpers.py +++ b/djangocms_versioning/test_utils/test_helpers.py @@ -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 diff --git a/tests/test_menus.py b/tests/test_menus.py index 384a7853..5340d82d 100644 --- a/tests/test_menus.py +++ b/tests/test_menus.py @@ -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}