Modify Group
************

:Test-Layer: functional

Our functional testing set-up has created and configured a working
instance of a GUM site. It connects to an LDAP testing environment:

  >>> gumsite = getRootFolder()['gumsite']
  >>> dbc = gumsite.ldap_connection()
  >>> str(dbc)[:42]
  '<ldapadapter.utility.LDAPConnection object'

We can create a new Group by supplying a unique name:

  >>> from gum.group import Group
  >>> tribe = Group('mammoth hunters', None)

The Group object implements the IGroup interface, this is a schema that
describes all data about a Group:

  >>> from gum.interfaces import IGroup
  >>> IGroup.providedBy(tribe)
  True

Since Groups are about Users, we'll create a User to test:

  >>> from gum.user import User
  >>> grokuser = User('grok',**{'cn':'ME GROK','sn':'ZOPE'})
  >>> grokuser.save()

We can modify the Group object. LDAP is not updated until we call an explicit save:

  >>> tribe.description = 'band of neanderthals'
  >>> tribe.uids = ['grok',]
  >>> tribe.save()

Finally, we can delete an entry. In Zope 3 style, delete is the responsibility
of the Groups container:

  >>> del gumsite['groups']['mammoth hunters']
  >>> del gumsite['users']['grok']


