==========================
PAU Sample Data Generation
==========================

This generator creates a pluggable authentication utility.

  >>> from z3c.sampledata.generator.pau import SamplePau
  >>> generator = SamplePau()

For the creation of the utility we need a site.
To create our site we use the site generator.

  >>> from pprint import pprint
  >>> from zope import component
  >>> from z3c.sampledata.interfaces import ISampleDataPlugin
  >>> from z3c.sampledata import Manager
  >>> from z3c.sampledata.generator.site import SampleSite
  >>> component.provideUtility(SampleSite(),
  ...                          ISampleDataPlugin,
  ...                          'z3c.sampledata.site')
  >>> manager = Manager('manager', '')
  >>> manager.add('z3c.sampledata.site')
  >>> from zope.site.folder import Folder
  >>> infos = manager.generate(context=root,
  ...                          param={'z3c.sampledata.site':
  ...                                      {'sitename':'test'}},
  ...                          seed=None)
  >>> root['test']
  <zope.site.folder.Folder object at ...>

Now that everything is set up we can generate the intids utility-

  >>> site = root['test']
  >>> generator.generate(site)
  <zope.pluggableauth.authentication.PluggableAuthentication object at ...>
  >>> 'pau' in site.getSiteManager()['default']
  True
  >>> from zope import component
  >>> from zope.authentication.interfaces import IAuthentication
  >>> component.getUtility(IAuthentication)
  <zope.pluggableauth.authentication.PluggableAuthentication object at ...>
