WorldCookery Site
=================

First we instantiate a *WorldCookery Site* object and find that it
does not have a site manager yet:

  >>> from worldcookery.site import WorldCookerySite
  >>> worldcookery_site = WorldCookerySite()
  >>> worldcookery_site.getSiteManager()
  Traceback (most recent call last):
    ...
  ComponentLookupError: no site manager defined

However, after adding it to a folder hierarchy that has a root, we see
that it now has a site manager:

  >>> from zope.app.folder import rootFolder
  >>> root = rootFolder()
  >>> root[u'worldcookery_site'] = worldcookery_site
  >>> sitemanager = worldcookery_site.getSiteManager()
  >>> sitemanager
  <LocalSiteManager ++etc++site>

We can also verify whether the kitchen tools utility has been created:

  >>> u'kitchentools' in sitemanager
  True

Let us now test local component lookup.  First we modify the local
kitchen tools utility so we can distinguish it from the global one:

  >>> kitchentools = sitemanager[u'kitchentools']
  >>> kitchentools.kitchen_tools.append(u'Spoon')

Without making ``worldcookery_site``'s site manager the current
component registry, the global utility will be found.  It does not
have the new kitchen tool.  After setting the site (this is what
normally happens during traversal), we get the local utility:

  >>> from zope.component import getUtility
  >>> from worldcookery.interfaces import IKitchenTools
  >>> u'Spoon' in getUtility(IKitchenTools).kitchen_tools
  False
  >>> from zope.app.component.site import setSite
  >>> setSite(worldcookery_site)
  >>> u'Spoon' in getUtility(IKitchenTools).kitchen_tools
  True
