'Testing iq/pubsub/publish stanzas'

def testPublish(self):

    iq = self.Iq()
    iq['pubsub']['publish']['node'] = 'thingers'
    payload = ET.fromstring('\n                                        <thinger    xmlns="http://andyet.net/protocol/thinger"    x="1"    y=\'2\'>\n                                                    <child1    />\n                                                    <child2    normandy=\'cheese\'    foo=\'bar\'    />\n                                            </thinger>')
    payload2 = ET.fromstring('\n                                        <thinger2    xmlns="http://andyet.net/protocol/thinger2"    x="12"    y=\'22\'>\n                                                <child12    />\n                                                <child22    normandy=\'cheese2\'    foo=\'bar2\'    />\n                                            </thinger2>')
    item = pubsub.Item()
    item['id'] = 'asdf'
    item['payload'] = payload
    item2 = pubsub.Item()
    item2['id'] = 'asdf2'
    item2['payload'] = payload2
    iq['pubsub']['publish'].append(item)
    iq['pubsub']['publish'].append(item2)
    form = xep_0004.Form()
    form.addField('pubsub#description', ftype='text-single', value='this    thing    is    awesome')
    iq['pubsub']['publish_options'] = form
    self.check(iq, '\n                                        <iq    id="0">\n                                                <pubsub    xmlns="http://jabber.org/protocol/pubsub">\n                                                        <publish    node="thingers">\n                                                                <item    id="asdf">\n                                                                        <thinger    xmlns="http://andyet.net/protocol/thinger"    y="2"    x="1">\n                                                                                <child1    />\n                                                                                <child2    foo="bar"    normandy="cheese"    />\n                                                                        </thinger>\n                                                                </item>\n                                                                <item    id="asdf2">\n                                                                        <thinger2    xmlns="http://andyet.net/protocol/thinger2"    y="22"    x="12">\n                                                                                <child12    />\n                                                                                <child22    foo="bar2"    normandy="cheese2"    />\n                                                                        </thinger2>\n                                                                </item>\n                                                        </publish>\n                                                        <publish-options>\n                                                                <x    xmlns="jabber:x:data"    type="submit">\n                                                                        <field    var="pubsub#description">\n                                                                                <value>this    thing    is    awesome</value>\n                                                                        </field>\n                                                                </x>\n                                                        </publish-options>\n                                                </pubsub>\n                                        </iq>')
