'test recomputation on recursively dependent field'

def test_12_recursive_recompute(self):

    a = self.env['test_new_api.recursive'].create({'name': 'A'})
    b = self.env['test_new_api.recursive'].create({'name': 'B', 'parent': a.id})
    c = self.env['test_new_api.recursive'].create({'name': 'C', 'parent': b.id})
    d = self.env['test_new_api.recursive'].create({'name': 'D', 'parent': c.id})
    self.assertEqual(a.display_name, 'A')
    self.assertEqual(b.display_name, 'A    /    B')
    self.assertEqual(c.display_name, 'A    /    B    /    C')
    self.assertEqual(d.display_name, 'A    /    B    /    C    /    D')
    b.parent = False
    self.assertEqual(a.display_name, 'A')
    self.assertEqual(b.display_name, 'B')
    self.assertEqual(c.display_name, 'B    /    C')
    self.assertEqual(d.display_name, 'B    /    C    /    D')
    b.name = 'X'
    self.assertEqual(a.display_name, 'A')
    self.assertEqual(b.display_name, 'X')
    self.assertEqual(c.display_name, 'X    /    C')
    self.assertEqual(d.display_name, 'X    /    C    /    D')
