def test_on_default(self):

        xml = """
        <iq type='get' to='pubsub.example.org'
                       from='user@example.org'>
          <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
            <default/>
          </pubsub>
        </iq>
        """
        fieldDefs = {
                "pubsub#persist_items":
                    {"type": "boolean",
                     "label": "Persist items to storage"},
                "pubsub#deliver_payloads":
                    {"type": "boolean",
                     "label": "Deliver payloads with event notifications"}
                }

        def getConfigurationOptions():
            return fieldDefs

        def default(request):
            return defer.succeed({'pubsub#persist_items': 'false',
                                  'x-myfield': '1'})

        def cb(element):
            self.assertEquals('pubsub', element.name)
            self.assertEquals(NS_PUBSUB_OWNER, element.uri)
            self.assertEquals(NS_PUBSUB_OWNER, element.default.uri)
            form = data_form.Form.fromElement(element.default.x)
            self.assertEquals(NS_PUBSUB_NODE_CONFIG, form.formNamespace)
            form.typeCheck(fieldDefs)
            self.assertIn('pubsub#persist_items', form.fields)
            self.assertFalse(form.fields['pubsub#persist_items'].value)
            self.assertNotIn('x-myfield', form.fields)

        self.resource.getConfigurationOptions = getConfigurationOptions
        self.resource.default = default
        verify.verifyObject(iwokkel.IPubSubResource, self.resource)
        d = self.handleRequest(xml)
        d.addCallback(cb)
        return d
Create a new non-persistent Message.
dataset/ETHPy150Open ralphm/wokkel/wokkel/test/test_pubsub.py/PubSubServiceTest.test_on_default--crossover with--dataset/ETHPy150Open ofa/connect/open_connect/connectmessages/tests/__init__.py/ConnectMessageTestCase.message