Code optimisé
This commit is contained in:
parent
176e5ce696
commit
007af79930
@ -50,17 +50,11 @@ class TestCoworkingCoworker(TransactionCase):
|
||||
|
||||
def test_manage_coworker_type(self):
|
||||
""" Test that non-coworker have not coworker_type fixed """
|
||||
homer = self.env['res.partner'].create({'name': 'Homer Simpson', 'is_coworker': False})
|
||||
self.assertFalse(homer.coworker_type)
|
||||
self.homer.write({'is_coworker': False})
|
||||
self.assertFalse(self.homer.coworker_type)
|
||||
|
||||
homer = self.env['res.partner'].create({'name': 'Homer Simpson',
|
||||
'is_coworker': True,
|
||||
'coworker_type': 'visitor'})
|
||||
self.assertEqual(homer.coworker_type, 'visitor')
|
||||
self.homer.write({'coworker_type': 'visitor'})
|
||||
self.assertEqual(self.homer.coworker_type, 'visitor')
|
||||
|
||||
|
||||
homer = self.env['res.partner'].create({'name': 'Homer Simpson',
|
||||
'is_coworker': False,
|
||||
'coworker_type': 'staffer'})
|
||||
|
||||
self.assertFalse(homer.coworker_type)
|
||||
self.homer.write({'is_coworker': False, 'coworker_type': 'staffer'})
|
||||
self.assertFalse(self.homer.coworker_type)
|
||||
|
Loading…
Reference in New Issue
Block a user