'A request for old messages with a narrow by pm-with only returns
conversations with that user.'

def test_get_messages_with_narrow_pm_with(self):

    me = self.example_email('hamlet')
    def dr_emails(dr):
        assert isinstance(dr, list)
        return ','.join(sorted(set(([r['email'] for r in dr] + [me]))))
    self.send_message(me, self.example_email('iago'), Recipient.PERSONAL)
    self.send_message(me, [self.example_email('iago'), self.example_email('cordelia')], Recipient.HUDDLE)
    personals = [m for m in get_user_messages(self.example_user('hamlet')) if ((m.recipient.type == Recipient.PERSONAL) or (m.recipient.type == Recipient.HUDDLE))]
    for personal in personals:
        emails = dr_emails(get_display_recipient(personal.recipient))
        self.login(me)
        narrow = [dict(operator='pm-with', operand=emails)]
        result = self.get_and_check_messages(dict(narrow=ujson.dumps(narrow)))
        for message in result['messages']:
            self.assertEqual(dr_emails(message['display_recipient']), emails)
