Skins control panel
===================

First some initial setup code:

    >>> from Products.CMFCore.utils import getToolByName
    >>> stool = getToolByName(self.portal, 'portal_skins')
    >>> self.loginAsManager()

Fake a second available skin:

    >>> stool.selections['TestSkin'] = 'test_path'

Make sure we assume the right defaults
--------------------------------------

    >>> stool.default_skin
    'Plone Default'

    >>> stool.getSkinSelections()
    ['Plone Default', 'TestSkin']

Viewing the skins control panel
-------------------------------

    >>> self.browser.open('http://nohost/plone/@@skins-controlpanel')
    >>> self.browser.url.endswith('skins-controlpanel')
    True

Click the cancel button:

    >>> self.browser.getControl(name="form.actions.cancel").click()
    >>> self.browser.url.endswith('plone_control_panel')
    True

There should be still no changes:

    >>> 'Changes canceled.' in self.browser.contents
    True

Make some changes
-----------------

    >>> self.browser.open('http://nohost/plone/@@skins-controlpanel')
    >>> self.browser.url.endswith('skins-controlpanel')
    True

    >>> self.browser.getControl(name='form.theme').value = ('TestSkin', )

Click the save button:

    >>> self.browser.getControl(name="form.actions.save").click()
    >>> self.browser.url.endswith('skins-controlpanel')
    True

We should be informed that something has changed:

    >>> 'Changes saved.' in self.browser.contents
    True

Make sure the changes have been applied correctly to the mailhost:

    >>> stool.default_skin
    'TestSkin'
