def test_on_affiliationsSet(self):

        xml = """
        <iq type='set' to='pubsub.example.org'
                       from='user@example.org'>
          <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>
            <affiliations node='test'>
              <affiliation jid='other@example.org' affiliation='publisher'/>
            </affiliations>
          </pubsub>
        </iq>
        """

        def affiliationsSet(request):
            self.assertEquals(u'test', request.nodeIdentifier)
            otherJID = JID(u'other@example.org')
            self.assertIn(otherJID, request.affiliations)
            self.assertEquals(u'publisher', request.affiliations[otherJID])

        self.resource.affiliationsSet = affiliationsSet
        return self.handleRequest(xml)
Setting node affiliations has the affiliations to be modified.
dataset/ETHPy150Open ralphm/wokkel/wokkel/test/test_pubsub.py/PubSubServiceTest.test_on_affiliationsSet