Esempio n. 1
0
    def test_normal( self ):

        _IDS = ( 'one', 'two', 'three' )
        _FSDVS = [ ( id, DummyFSDV( id ) ) for id in _IDS ]
        _PATHS = { 'basic' : 'one'
                 , 'fancy' : 'three, two, one'
                 }

        site = self._initSite( selections=_PATHS, fsdvs=_FSDVS )
        tool = site.portal_skins
        tool.default_skin = 'basic'
        tool.request_varname = 'skin_var'
        tool.allow_any = True
        tool.cookie_persistence = True

        context = DummyExportContext( site )

        from Products.CMFSetup.skins import exportSkinsTool
        exportSkinsTool( context )

        self.assertEqual( len( context._wrote ), 1 )
        filename, text, content_type = context._wrote[ 0 ]
        self.assertEqual( filename, 'skins.xml' )
        self._compareDOM( text, _NORMAL_EXPORT )
        self.assertEqual( content_type, 'text/xml' )
Esempio n. 2
0
    def test_normal( self ):

        _IDS = ( 'one', 'two', 'three' )
        _FSDVS = [ ( id, DummyFSDV( id ) ) for id in _IDS ]
        _PATHS = { 'basic' : 'one'
                 , 'fancy' : 'three, two, one'
                 }

        site = self._initSite( selections=_PATHS, fsdvs=_FSDVS )
        tool = site.portal_skins
        tool.default_skin = 'basic'
        tool.request_varname = 'skin_var'
        tool.allow_any = True
        tool.cookie_persistence = True

        context = DummyExportContext( site )

        from Products.CMFSetup.skins import exportSkinsTool
        exportSkinsTool( context )

        self.assertEqual( len( context._wrote ), 1 )
        filename, text, content_type = context._wrote[ 0 ]
        self.assertEqual( filename, 'skins.xml' )
        self._compareDOM( text, _NORMAL_EXPORT )
        self.assertEqual( content_type, 'text/xml' )
Esempio n. 3
0
    def test_empty( self ):

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

        from Products.CMFSetup.skins import exportSkinsTool
        exportSkinsTool( context )

        self.assertEqual( len( context._wrote ), 1 )
        filename, text, content_type = context._wrote[ 0 ]
        self.assertEqual( filename, 'skins.xml' )
        self._compareDOM( text, _EMPTY_EXPORT )
        self.assertEqual( content_type, 'text/xml' )
Esempio n. 4
0
    def test_empty(self):

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

        from Products.CMFSetup.skins import exportSkinsTool
        exportSkinsTool(context)

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