'check the extension of a field in an inherited model'

def test_20_field_extension(self):

    mother = self.env['test.inherit.mother']
    daughter = self.env['test.inherit.daughter']
    field = mother._fields['name']
    self.assertTrue(field.required)
    self.assertEqual(field.default(mother), 'Bar')
    self.assertEqual(mother.default_get(['name']), {'name': 'Bar'})
    field = daughter._fields['name']
    self.assertFalse(field.required)
    self.assertEqual(field.default(daughter), 'Baz')
    self.assertEqual(daughter.default_get(['name']), {'name': 'Baz'})
    field = mother._fields['state']
    self.assertFalse(field.default)
    self.assertEqual(mother.default_get(['state']), {})
    field = daughter._fields['template_id']
    self.assertEqual(field.comodel_name, 'test.inherit.mother')
    self.assertEqual(field.string, 'Template')
    self.assertTrue(field.required)
