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

def test_get_messages_with_narrow_group_pm_with(self):

    me = self.example_email('hamlet')
    matching_message_ids = []
    matching_message_ids.append(self.send_message(me, [self.example_email('iago'), self.example_email('cordelia'), self.example_email('othello')], Recipient.HUDDLE))
    matching_message_ids.append(self.send_message(me, [self.example_email('cordelia'), self.example_email('othello')], Recipient.HUDDLE))
    non_matching_message_ids = []
    non_matching_message_ids.append(self.send_message(me, self.example_email('cordelia'), Recipient.PERSONAL))
    non_matching_message_ids.append(self.send_message(me, [self.example_email('iago'), self.example_email('othello')], Recipient.HUDDLE))
    non_matching_message_ids.append(self.send_message(self.example_email('cordelia'), [self.example_email('iago'), self.example_email('othello')], Recipient.HUDDLE))
    self.login(me)
    narrow = [dict(operator='group-pm-with', operand=self.example_email('cordelia'))]
    result = self.get_and_check_messages(dict(narrow=ujson.dumps(narrow)))
    for message in result['messages']:
        self.assertIn(message['id'], matching_message_ids)
        self.assertNotIn(message['id'], non_matching_message_ids)
