'Test that a response stanza is generated with addressing swapped.'

def test_toResponse(self):

    stanza = domish.Element(('jabber:client', 'iq'))
    stanza['type'] = 'get'
    stanza['to'] = 'user1@example.com'
    stanza['from'] = 'user2@example.com/resource'
    stanza['id'] = 'stanza1'
    response = xmlstream.toResponse(stanza, 'result')
    self.assertNotIdentical(stanza, response)
    self.assertEqual(response['from'], 'user1@example.com')
    self.assertEqual(response['to'], 'user2@example.com/resource')
    self.assertEqual(response['type'], 'result')
    self.assertEqual(response['id'], 'stanza1')
