Permalink
Browse files

Merge branch 'test_improvments' of git://github.com/fivethreeo/django…

…-cms into test_improvements
  • Loading branch information...
2 parents 5a1bf69 + 581e61b commit 6b3c60c7d38ff6b5112ac618b661f1f05d25b9f5 Jonas Obrist committed Dec 30, 2010
Showing with 11 additions and 11 deletions.
  1. +1 −1 cms/models/managers.py
  2. +10 −10 cms/tests/permmod.py
View
@@ -472,7 +472,7 @@ def __get_id_list(self, user, site, attr):
elif permission.grant_on & MASK_DESCENDANTS:
page_id_allow_list.extend(permission.page.get_descendants().values_list('id', flat=True))
- print 'descendants for pages in permissions for (' + str(user) + ') : ' + str(desc_list) # no pages with permissions has descendants???
+ # print 'descendants for pages in permissions for (' + str(user) + ') : ' + str(desc_list) # no pages with permissions has descendants???
# store value in cache
#set_permission_cache(user, attr, page_id_allow_list)
View
@@ -232,12 +232,11 @@ def setUp(self):
self.login_user(self.user_super)
self.home_page = self.create_page(title="home", user=self.user_super)
- self.publish_page(self.home_page )
# master page & master user
self.master_page = self.create_page(title="master")
- self.publish_page(self.master_page)
+
# create master user
self.user_master = self.create_page_user("master", grant_all=True)
@@ -264,6 +263,9 @@ def setUp(self):
can_add=True, can_change=True, can_delete=True, can_publish=True,
can_move_page=True, can_moderate=True)
+ # publish after creating all drafts
+ self.publish_page(self.home_page)
+ self.publish_page(self.master_page)
# logg in as master, and request moderation for slave page and descendants
self.request_moderation(self.slave_page, 7)
@@ -345,16 +347,14 @@ def test_06_page_added_by_slave_can_be_published_approved_by_user_master(self):
# must not have public object yet
self.assertFalse(page.publisher_public)
+
+ # print ('descendants of master page (%s): ' % self.master_page.pk) + str([(spage, spage.pk) for spage in self.reload_page(self.master_page).get_descendants()])
- print 'pk of created page: ' + str(page.pk)
+ # print ('ancestors of created page (%s): ' % page.pk) + str([(spage, spage.pk) for spage in page.get_ancestors()])
- print 'descendants of master page: ' + str([(spage, spage.pk) for spage in self.master_page.get_descendants()])
+ # print ('descendants of slave page (%s): ' % self.slave_page.pk) + str([(spage, spage.pk) for spage in self.reload_page(self.slave_page).get_descendants()])
- print 'ancestors of created page: ' + str([(spage, spage.pk) for spage in page.get_ancestors()])
-
- print 'descendants of slave page: ' + str([(spage, spage.pk) for spage in self.slave_page.get_descendants()])
-
- print 'ancestors of slave page: ' + str([(spage, spage.pk) for spage in self.slave_page.get_ancestors()])
+ # print ('ancestors of slave page (%s): ' % self.slave_page.pk) + str([(spage, spage.pk) for spage in self.slave_page.get_ancestors()])
self.assertTrue(has_generic_permission(page.pk, self.user_master, "publish", 1))
# should be True user_master should have publish permissions for childred aswell
@@ -506,7 +506,7 @@ def test_16_moderator_flags(self):
"""Add page under slave_home and check its flag
"""
self.login_user(self.user_slave)
- page = self.create_page(self.slave_page)
+ page = self.create_page(parent_page=self.slave_page)
# moderator_state must be changed
self.assertEqual(page.moderator_state, Page.MODERATOR_CHANGED)

0 comments on commit 6b3c60c

Please sign in to comment.