'Test that specifying an anchor but 0 for num_before and num_after
returns at most 1 message.'

def test_get_messages_with_only_searching_anchor(self):

    self.login(self.example_email('cordelia'))
    anchor = self.send_message(self.example_email('cordelia'), 'Verona', Recipient.STREAM)
    narrow = [dict(operator='sender', operand=self.example_email('cordelia'))]
    result = self.get_and_check_messages(dict(narrow=ujson.dumps(narrow), anchor=anchor, num_before=0, num_after=0))
    self.assertEqual(len(result['messages']), 1)
    narrow = [dict(operator='is', operand='mentioned')]
    result = self.get_and_check_messages(dict(narrow=ujson.dumps(narrow), anchor=anchor, num_before=0, num_after=0))
    self.assertEqual(len(result['messages']), 0)
