Test the topicgroup type

Create a testbrowser
    >>> aBrowser = self.makeAdminBrowser()

Create a topicgroup

First, we create a Topic Group.
    >>> aBrowser.open(self.folder.absolute_url())
    >>> topicGroupLink = aBrowser.getLink(text='Topic Group')
    >>> topicGroupLink #Make sure we got the link
    <Link ...>
    >>> topicGroupLink.click()
    >>> 'topicgroup' in aBrowser.url and 'edit' in aBrowser.url
    True
    >>> form = aBrowser.getForm(name='edit_form')
    >>> form.getControl('Title').value = 'TopicGroup'
    >>> form.getControl('Description').value = 'TopicGroup Description'
    >>> form.submit()

Make sure the topicgroup was created
    >>> tg = self.folder.getFirstChild()
    >>> tg
    <TopicGroup at ...>

Check the display
All possible fields are currently filled in
    >>> start = aBrowser.contents.find('collective-types-topicgroup') - 31
    >>> aSnippet = aBrowser.contents[start:]
    >>> 'class="collective-types-topicgroup"' in aSnippet
    True

Add a couple of pages to our TopicGroup
    >>> pageLink = aBrowser.getLink(id='document')
    >>> pageLink
    <Link ...>
    >>> pageLink.click()
    >>> 'document' in aBrowser.url and 'edit' in aBrowser.url
    True
    >>> form = aBrowser.getForm(name='edit_form')
    >>> form.getControl('Title').value = 'Page1'
    >>> form.submit()
    >>> aBrowser.getLink(text="TopicGroup").click()

Another page
    >>> pageLink = aBrowser.getLink(text='Page', id='document')
    >>> pageLink
    <Link ...?type_name=Document'>
    >>> pageLink.click()
    >>> 'document' in aBrowser.url and 'edit' in aBrowser.url
    True
    >>> form = aBrowser.getForm(name='edit_form')
    >>> form.getControl('Title').value = 'Page2'
    >>> form.submit()
    >>> aBrowser.getLink(text="TopicGroup").click()

Let's see what we've got now.  We should be able to see the two items that we've created.  Their titles will be inside header tags.
    >>> aDisplay = aBrowser.contents
    >>> grabH1 = lambda x: x.split('</h1>')[0]
    >>> section = aDisplay.split('<h1 class="documentFirstHeading">')
    >>> page1 = grabH1(section[1])
    >>> 'Page1' in page1
    True
    >>> page2 = grabH1(section[2])
    >>> 'Page2' in page2
    True

Yay!  Both our new objects are listed in the topicgroup.
    
