Code optimisé

This commit is contained in:
michel 2017-12-04 14:16:05 +01:00
parent 176e5ce696
commit 007af79930

View File

@ -50,17 +50,11 @@ class TestCoworkingCoworker(TransactionCase):
def test_manage_coworker_type(self): def test_manage_coworker_type(self):
""" Test that non-coworker have not coworker_type fixed """ """ Test that non-coworker have not coworker_type fixed """
homer = self.env['res.partner'].create({'name': 'Homer Simpson', 'is_coworker': False}) self.homer.write({'is_coworker': False})
self.assertFalse(homer.coworker_type) self.assertFalse(self.homer.coworker_type)
homer = self.env['res.partner'].create({'name': 'Homer Simpson', self.homer.write({'coworker_type': 'visitor'})
'is_coworker': True, self.assertEqual(self.homer.coworker_type, 'visitor')
'coworker_type': 'visitor'})
self.assertEqual(homer.coworker_type, 'visitor')
self.homer.write({'is_coworker': False, 'coworker_type': 'staffer'})
homer = self.env['res.partner'].create({'name': 'Homer Simpson', self.assertFalse(self.homer.coworker_type)
'is_coworker': False,
'coworker_type': 'staffer'})
self.assertFalse(homer.coworker_type)