Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(7)  |  Derive(0)  |  Import(1)

src/c/o/collective.groupspace.roles-1.0.3/collective/groupspace/roles/tests/test_localroles.py   collective.groupspace.roles(Download)
import unittest
from base import PloneTestCase
from collective.groupspace.roles.localroles import allowedLocalUsersAndGroups
from collective.groupspace.roles.localroles import LocalRoles
from collective.groupspace.roles.localroles import setPolicyDefaultLocalRoles
        are deleted or set.
        """
        setPolicyDefaultLocalRoles(self.obj, self.event)
        self.failUnless(self.obj.reindexed == False)
        self.failUnless(self.obj.del_roles == [])
        """
        self.event.new_user_roles = {'user1':['role1', 'role2']}
        setPolicyDefaultLocalRoles(self.obj, self.event)
        self.failUnless(self.obj.reindexed == True)
        self.failUnless(self.obj.del_roles == [])
        self.event.old_user_roles = {'user1':['role1']}
        self.event.new_user_roles = {'user1':['role1', 'role2']}
        setPolicyDefaultLocalRoles(self.obj, self.event)
        self.failUnless(self.obj.reindexed == True)
        self.failUnless(self.obj.del_roles == [])
        self.event.old_user_roles = {'user1':['role1', 'role2']}
        self.event.new_user_roles = {} 
        setPolicyDefaultLocalRoles(self.obj, self.event)
        self.failUnless(self.obj.reindexed == True)
        self.failUnless(self.obj.del_roles == ['user1'])