8000 Remove Publish button from the toolbar by Aiky30 · Pull Request #6414 · django-cms/django-cms · GitHub
[go: up one dir, main page]

Skip to content

Remove Publish button from the toolbar #6414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 14, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to f 10000 ile
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove tests that check for the publish button.
  • Loading branch information
Andrew Aikman authored and vxsx committed Jun 14, 2018
commit 8f302d829ed917a75c89045b2ba326f13aba5c39
40 changes: 0 additions & 40 deletions cms/tests/test_toolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from cms.cms_toolbars import (ADMIN_MENU_IDENTIFIER, ADMINISTRATION_BREAK, get_user_model,
LANGUAGE_MENU_IDENTIFIER)
from cms.middleware.toolbar import ToolbarMiddleware
from cms.constants import PUBLISHER_STATE_DIRTY
from cms.models import Page, UserSettings, PagePermission
from cms.test_utils.project.placeholderapp.models import (Example1, CharPksExample,
MultilingualExample1)
Expand Down Expand Up @@ -644,45 +643,6 @@ def test_show_toolbar_without_edit(self):
toolbar = CMSToolbar(request)
self.assertFalse(toolbar.show_toolbar)

def test_publish_button(self):
page = create_page('test', 'nav_playground.html', 'en', published=True)
# Needed because publish button only shows if the page is dirty
page.set_publisher_state('en', state=PUBLISHER_STATE_DIRTY)

request = self.get_page_request(page, self.get_superuser(), edit=True)
toolbar = CMSToolbar(request)
toolbar.populate()
toolbar.post_template_populate()
self.assertTrue(toolbar.edit_mode_active)
items = toolbar.get_left_items() + toolbar.get_right_items()
self.assertEqual(len(items), 7)

def test_no_publish_button(self):
page = create_page('test', 'nav_playground.html', 'en', published=True)
user = self.get_staff()
request = self.get_page_request(page, user, edit=True)
toolbar = CMSToolbar(request)
toolbar.populate()
toolbar.post_template_populate()
self.assertTrue(page.has_change_permission(request.user))
self.assertFalse(page.has_publish_permission(request.user))
self.assertTrue(toolbar.edit_mode_active)
items = toolbar.get_left_items() + toolbar.get_right_items()
# Logo + templates + page-menu + admin-menu + logout
self.assertEqual(len(items), 5)

# adding back structure mode permission
permission = Permission.objects.get(codename='use_structure')
user.user_permissions.add(permission)

request.user = get_user_model().objects.get(pk=user.pk)
toolbar = CMSToolbar(request)
toolbar.populate()
toolbar.post_template_populate()
items = toolbar.get_left_items() + toolbar.get_right_items()
# Logo + edit mode + templates + page-menu + admin-menu + logout
self.assertEqual(len(items), 6)

def test_no_change_button(self):
page = create_page('test', 'nav_playground.html', 'en', published=True)
user = self.get_staff()
Expand Down
0