Skip to content

Commit

Permalink
Add test for anonymous permissions bug (#4082).
Browse files Browse the repository at this point in the history
  • Loading branch information
timgraham committed May 4, 2015
1 parent cd73105 commit 8a7ccaf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cms/tests/menu_page_viewperm.py
Expand Up @@ -516,6 +516,18 @@ def test_menu_access_page_group_5(self):
self.assertViewAllowed(urls["/en/page_d/"], user)
self.assertViewAllowed(urls["/en/page_d/page_d_a/"], user)

def test_non_view_permission_doesnt_hide(self):
"""
PagePermissions with can_view=False shouldn't hide pages in the menu.
"""
self._setup_user_groups()
all_pages = self._setup_tree_pages()
page = Page.objects.drafts().get(title_set__title="page_b")
group = Group.objects.get(name=self.GROUPNAME_1)
PagePermission.objects.create(can_view=False, group=group, page=page)
urls = self.get_url_dict(all_pages)
self.assertInMenu(urls["/en/page_b/"], AnonymousUser())


@override_settings(
CMS_PERMISSION=True,
Expand Down

0 comments on commit 8a7ccaf

Please sign in to comment.