'Test getting a pubsub specific condition from an error stanza'

def testPubsubError(self):

    iq = self.Iq()
    iq['error']['type'] = 'cancel'
    iq['error']['code'] = '501'
    iq['error']['condition'] = 'feature-not-implemented'
    iq['error']['pubsub']['condition'] = 'subid-required'
    self.check(iq, '\n                                        <iq    type="error">\n                                                <error    type="cancel"    code="501">\n                                                        <feature-not-implemented    xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"    />\n                                                        <subid-required    xmlns="http://jabber.org/protocol/pubsub#errors"    />\n                                                </error>\n                                        </iq>\n                                ', use_values=False)
    del iq['error']['pubsub']['condition']
    self.check(iq, '\n                                        <iq    type="error">\n                                                <error    type="cancel"    code="501">\n                                                        <feature-not-implemented    xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"    />\n                                                </error>\n                                        </iq>\n                                ', use_values=False)
