'test search on computed fields'

def test_14_search(self):

    discussion = self.env.ref('test_new_api.discussion_0')
    sizes = set((message.size for message in discussion.messages))
    for size in sizes:
        messages0 = self.env['test_new_api.message'].search([('discussion', '=', discussion.id), ('size', '<=', size)])
        messages1 = self.env['test_new_api.message'].browse()
        for message in discussion.messages:
            if (message.size <= size):
                messages1 += message
        self.assertEqual(messages0, messages1)
