Imports and variables:

    >>> import plone.testing.z2 as helpers
    >>> from plone.app.testing import login, logout, TEST_USER_NAME, TEST_USER_ID, setRoles
    >>> from Products.CMFCore.utils import getToolByName
    >>> import transaction
    >>> app = layer.get('app')
    >>> portal = layer.get('portal')
    >>> request = layer.get('request')
    >>> browser = helpers.Browser(app)
    >>> browser.handleErrors = False
    >>> setRoles(portal, TEST_USER_ID, ['Manager'])
    >>> portal_url = portal.absolute_url()
    >>> portal_skins = getToolByName(portal, 'portal_skins')
    >>> default_skin = portal_skins.getDefaultSkin()


User enters on the new created Plone site

    >>> browser.open(portal_url)

Grayscale is not yet enabled for the default theme

    >>> "grayscale=1" not in browser.contents
    True
    >>> portal.portal_properties.site_properties.transformed_themes
    ()

User log in as an administrator and set up grayscale for default theme

    >>> login(portal, TEST_USER_NAME)
    >>> portal.portal_properties.site_properties.manage_changeProperties(
    ... **{'transformed_themes': (default_skin, )})
    >>> transaction.commit()

User reloads page and see stxnext.grayscale in action    

    >>> browser.reload()
    >>> (default_skin, ) == portal.portal_properties.site_properties.transformed_themes
    True

Images URL has a 'grayscale=1' added to prevent caching

    >>> browser.contents
    '...logo.png?grayscale=1"...'

New CSS class was added to body tag
    
    >>> browser.contents
    '...<body class="gray-style...' 
