'Test publishing a single item, with options.'

def testPublishSingleOptions(self):

    payload = AtomEntry()
    payload['title'] = 'Test'
    register_stanza_plugin(self.xmpp['xep_0060'].stanza.Item, AtomEntry)
    options = self.xmpp['xep_0004'].make_form()
    options.add_field(var='FORM_TYPE', ftype='hidden', value='http://jabber.org/protocol/pubsub#publish-options')
    options.add_field(var='pubsub#access_model', ftype='text-single', value='presence')
    options['type'] = 'submit'
    self.xmpp['xep_0060'].publish('pubsub.example.com', 'somenode', id='ID42', payload=payload, options=options, block=False)
    self.send('\n                                        <iq    type="set"    id="1"    to="pubsub.example.com">\n                                                <pubsub    xmlns="http://jabber.org/protocol/pubsub">\n                                                        <publish    node="somenode">\n                                                                <item    id="ID42">\n                                                                        <entry    xmlns="http://www.w3.org/2005/Atom">\n                                                                                <title>Test</title>\n                                                                        </entry>\n                                                                </item>\n                                                        </publish>\n                                                        <publish-options>\n                                                                <x    xmlns="jabber:x:data"    type="submit">\n                                                                        <field    var="FORM_TYPE">\n                                                                                <value>http://jabber.org/protocol/pubsub#publish-options</value>\n                                                                        </field>\n                                                                        <field    var="pubsub#access_model">\n                                                                                <value>presence</value>\n                                                                        </field>\n                                                                </x>\n                                                        </publish-options>\n                                                </pubsub>\n                                        </iq>\n                                ', use_values=False)
