Skip to content
Browse files

fixed PermissionModeratorTestCase.test_06_page_added_by_slave_can_be_…

…published_approved_by_user_master, new failure in test_16_moderator_flags
  • Loading branch information...
1 parent 6b3c60c commit 426cb4c0506ea70221fe140f8fa970f6dbdd71f8 @fivethreeo fivethreeo committed Dec 30, 2010
Showing with 5 additions and 5 deletions.
  1. +3 −3 cms/tests/base.py
  2. +2 −2 cms/tests/permmod.py
View
6 cms/tests/base.py
@@ -121,7 +121,7 @@ def assertObjectDoesNotExist(self, qs, **filter):
raise self.failureException, "ObjectDoesNotExist not raised"
def create_page(self, parent_page=None, user=None, position="last-child",
- title=None, site=1, published=False, in_navigation=False, **extra):
+ title=None, site=1, published=False, in_navigation=False, moderate=False, **extra):
"""
Common way for page creation with some checks
"""
@@ -144,10 +144,10 @@ def create_page(self, parent_page=None, user=None, position="last-child",
page_data['parent'] = parent_page
page_data.update(**extra)
- page = Page.objects.create(**page_data)
+ page = Page(**page_data)
+ page.save()
if parent_page:
page.move_to(parent_page, position)
- page.save()
if settings.CMS_MODERATOR and user:
page.pagemoderator_set.create(user=user)
View
4 cms/tests/permmod.py
@@ -237,7 +237,6 @@ def setUp(self):
self.master_page = self.create_page(title="master")
-
# create master user
self.user_master = self.create_page_user("master", grant_all=True)
@@ -531,7 +530,7 @@ def test_16_moderator_flags(self):
self.assertEqual(page.moderator_state, Page.MODERATOR_APPROVED_WAITING_FOR_PARENTS)
# publish slave page
- slave_page = self.publish_page(self.slave_page)
+ slave_page = self.publish_page(self.slave_page, published_check=False)
self.assertEqual(not page.publisher_public, True)
self.assertEqual(not slave_page.publisher_public, True)
@@ -680,6 +679,7 @@ def test_19_remove_plugin_page_under_moderation(self):
# login as slave and create page
self.login_user(self.user_slave)
page = self.create_page(self.slave_page)
+ self.assertEqual(page.get_moderator_queryset().count(), 1)
# add plugin
plugin_id = self.add_plugin(self.user_slave, page)

0 comments on commit 426cb4c

Please sign in to comment.
Something went wrong with that request. Please try again.