Merge branch 'V5_unit_test' of ssh://git.yaltik.net:61722/michel/Coworking into V5_unit_test

This commit is contained in:
Fabien BOURGEOIS 2017-12-04 14:22:52 +01:00
commit 3a88646f7a

View File

@ -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)