コード例 #1
0
 def testAddRecursiveGroupsPlugin(self):
     acl = getToolByName(self.portal, 'acl_users')
     addRecursiveGroupsPlugin(self.portal)
     self.assertTrue('recursive_groups' in acl)
     # Now that we have an existing one, let's make sure it's handled
     # properly if this migration is run again.
     addRecursiveGroupsPlugin(self.portal)
     self.assertTrue('recursive_groups' in acl)
コード例 #2
0
ファイル: tests.py プロジェクト: gforcada/plone.app.upgrade
 def testAddRecursiveGroupsPlugin(self):
     acl = getToolByName(self.portal, 'acl_users')
     addRecursiveGroupsPlugin(self.portal)
     self.assertTrue('recursive_groups' in acl)
     # Now that we have an existing one, let's make sure it's handled
     # properly if this migration is run again.
     addRecursiveGroupsPlugin(self.portal)
     self.assertTrue('recursive_groups' in acl)
コード例 #3
0
    def testRepositionRecursiveGroupsPlugin(self):
        # Ensure that the recursive groups plugin is moved to the bottom
        # of the IGroups plugins list, if active.
        addRecursiveGroupsPlugin(self.portal)
        # Plugin is installed, but not active, run against this state.
        from Products.PluggableAuthService.interfaces.plugins import \
            IGroupsPlugin
        acl = getToolByName(self.portal, 'acl_users')
        plugins = acl.plugins
        # The plugin was originally moved to the top of the list of
        # IGroupsPlugin plugins by p.a.controlpanel. Recreate that state.
        while (plugins.getAllPlugins('IGroupsPlugin')['active'].index(
                'recursive_groups') > 0):
            plugins.movePluginsUp(IGroupsPlugin, ['recursive_groups'])

        active_groups = plugins.getAllPlugins('IGroupsPlugin')['active']
        self.assertEqual(active_groups[0], 'recursive_groups')

        # Rerun the migration, making sure that it's now the last item in the
        # list of IGroupsPlugin plugins.
        repositionRecursiveGroupsPlugin(self.portal)
        active_groups = plugins.getAllPlugins('IGroupsPlugin')['active']
        self.assertEqual(active_groups[-1], 'recursive_groups')
コード例 #4
0
ファイル: tests.py プロジェクト: gforcada/plone.app.upgrade
    def testRepositionRecursiveGroupsPlugin(self):
        # Ensure that the recursive groups plugin is moved to the bottom
        # of the IGroups plugins list, if active.
        addRecursiveGroupsPlugin(self.portal)
        # Plugin is installed, but not active, run against this state.
        from Products.PluggableAuthService.interfaces.plugins import \
            IGroupsPlugin
        acl = getToolByName(self.portal, 'acl_users')
        plugins = acl.plugins
        # The plugin was originally moved to the top of the list of
        # IGroupsPlugin plugins by p.a.controlpanel. Recreate that state.
        while (plugins.getAllPlugins('IGroupsPlugin')['active'].index(
               'recursive_groups') > 0):
            plugins.movePluginsUp(IGroupsPlugin, ['recursive_groups'])

        active_groups = plugins.getAllPlugins('IGroupsPlugin')['active']
        self.assertEqual(active_groups[0], 'recursive_groups')

        # Rerun the migration, making sure that it's now the last item in the
        # list of IGroupsPlugin plugins.
        repositionRecursiveGroupsPlugin(self.portal)
        active_groups = plugins.getAllPlugins('IGroupsPlugin')['active']
        self.assertEqual(active_groups[-1], 'recursive_groups')