test_inherits.py 1.2 KB

123456789101112131415161718192021222324252627282930
  1. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  2. from odoo.tests import common
  3. class test_inherits(common.TransactionCase):
  4. def test_ir_model_data_inherits_again(self):
  5. """ Re-run test_inherits test to make sure another imd hasn't been created """
  6. IrModelData = self.env['ir.model.data']
  7. field = IrModelData.search([('name', '=', 'field_test_unit__name')])
  8. self.assertEqual(len(field), 1)
  9. self.assertEqual(field.module, 'test_inherits')
  10. field = IrModelData.search([('name', '=', 'field_test_box__name')])
  11. self.assertEqual(len(field), 1)
  12. self.assertEqual(field.module, 'test_inherits')
  13. def test_ir_model_data_inherits_depends(self):
  14. """ Check the existence of the correct ir.model.data """
  15. IrModelData = self.env['ir.model.data']
  16. field = IrModelData.search([('name', '=', 'field_test_unit__second_name')])
  17. self.assertEqual(len(field), 1)
  18. self.assertEqual(field.module, 'test_inherits_depends')
  19. field = IrModelData.search([('name', '=', 'field_test_box__second_name')])
  20. self.assertEqual(len(field), 1)
  21. self.assertEqual(field.module, 'test_inherits_depends')