Example #1
0
    def test_empty( self ):

        from Products.CMFSetup.tool import TOOLSET_XML
        from Products.CMFSetup.tool import exportToolset

        site = self._initSite()
        context = DummyExportContext( site )

        exportToolset( context )

        self.assertEqual( len( context._wrote ), 1 )
        filename, text, content_type = context._wrote[ 0 ]
        self.assertEqual( filename, TOOLSET_XML )
        self._compareDOM( text, _EMPTY_TOOLSET_XML )
        self.assertEqual( content_type, 'text/xml' )
Example #2
0
    def test_empty(self):

        from Products.CMFSetup.tool import TOOLSET_XML
        from Products.CMFSetup.tool import exportToolset

        site = self._initSite()
        context = DummyExportContext(site)

        exportToolset(context)

        self.assertEqual(len(context._wrote), 1)
        filename, text, content_type = context._wrote[0]
        self.assertEqual(filename, TOOLSET_XML)
        self._compareDOM(text, _EMPTY_TOOLSET_XML)
        self.assertEqual(content_type, 'text/xml')
Example #3
0
    def test_normal( self ):

        from Products.CMFSetup.tool import TOOLSET_XML
        from Products.CMFSetup.tool import exportToolset

        site = self._initSite()
        toolset = site.portal_setup.getToolsetRegistry()
        toolset.addForbiddenTool( 'doomed' )
        toolset.addRequiredTool( 'mandatory', 'path.to.one' )
        toolset.addRequiredTool( 'obligatory', 'path.to.another' )

        context = DummyExportContext( site )

        exportToolset( context )

        self.assertEqual( len( context._wrote ), 1 )
        filename, text, content_type = context._wrote[ 0 ]
        self.assertEqual( filename, TOOLSET_XML )
        self._compareDOM( text, _NORMAL_TOOLSET_XML )
        self.assertEqual( content_type, 'text/xml' )
Example #4
0
    def test_normal(self):

        from Products.CMFSetup.tool import TOOLSET_XML
        from Products.CMFSetup.tool import exportToolset

        site = self._initSite()
        toolset = site.portal_setup.getToolsetRegistry()
        toolset.addForbiddenTool('doomed')
        toolset.addRequiredTool('mandatory', 'path.to.one')
        toolset.addRequiredTool('obligatory', 'path.to.another')

        context = DummyExportContext(site)

        exportToolset(context)

        self.assertEqual(len(context._wrote), 1)
        filename, text, content_type = context._wrote[0]
        self.assertEqual(filename, TOOLSET_XML)
        self._compareDOM(text, _NORMAL_TOOLSET_XML)
        self.assertEqual(content_type, 'text/xml')