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}