[FIX] tests: remove duplicate tests

The tests introduced in commit 4265026ee2
are replaced and optimized by the tests introduced in commit
cb4266787b
This commit is contained in:
Adrian Torres
2018-07-26 07:45:34 +02:00
parent 78eff004bf
commit a800e7f5ec
-42
View File
@@ -271,48 +271,6 @@ class TestCustomFields(common.TransactionCase):
with self.assertRaises(ValidationError):
self.create_field('foo')
def test_create_custom_o2m(self):
""" try creating a custom o2m and then deleting its m2o inverse """
model = self.env['ir.model'].search([('model', '=', self.MODEL)])
comodel = self.env['ir.model'].search([('model', '=', self.COMODEL)])
m2o_field = self.env['ir.model.fields'].create({
'model_id': comodel.id,
'name': 'x_my_m2o',
'field_description': 'my_m2o',
'ttype': 'many2one',
'relation': self.MODEL,
})
o2m_field = self.env['ir.model.fields'].create({
'model_id': model.id,
'name': 'x_my_o2m',
'field_description': 'my_o2m',
'ttype': 'one2many',
'relation': self.COMODEL,
'relation_field': m2o_field.name,
})
m2o_field.unlink()
self.assertFalse(o2m_field.exists())
def test_create_custom_related(self):
""" try creating a custom related then deleting its inverse """
comodel = self.env['ir.model'].search([('model', '=', self.COMODEL)])
field = self.create_field('x_my_char')
related_field = self.env['ir.model.fields'].create({
'model_id': comodel.id,
'name': 'x_oh_boy',
'field_description': 'x_oh_boy',
'ttype': 'char',
'related': 'partner_id.x_my_char',
})
field.unlink()
self.assertFalse(related_field.exists())
def test_rename_custom(self):
""" custom field names must be start with 'x_' """
field = self.create_field('x_foo')