'Test that using the wrong sender JID in a IQ result
doesn\'t trigger handlers.'

def testWrongSender(self):

    events = []
    def run_test():
        iq = self.Iq()
        iq['id'] = 'test'
        iq['to'] = 'tester@sleekxmpp.com/test'
        iq['type'] = 'set'
        iq['query'] = 'test'
        result = iq.send()
        events.append(result['from'].full)
    t = threading.Thread(name='sender_test', target=run_test)
    t.start()
    self.recv('\n                                <iq    id="test"    from="evil@sleekxmpp.com/bad"    type="result">\n                                        <query    xmlns="test"    />\n                                </iq>\n                        ')
    self.recv('\n                                <iq    id="test"    from="evil2@sleekxmpp.com"    type="result">\n                                        <query    xmlns="test"    />\n                                </iq>\n                        ')
    self.recv('\n                                <iq    id="test"    from="evil.com"    type="result">\n                                        <query    xmlns="test"    />\n                                </iq>\n                        ')
    self.recv('\n                                <iq    id="test"    from="tester@sleekxmpp.com/test"    type="result">\n                                        <query    xmlns="test"    />\n                                </iq>\n                        ')
    t.join()
    time.sleep(0.1)
    self.assertEqual(events, ['tester@sleekxmpp.com/test'], 'Did    not    timeout    on    bad    sender')
