Debut du test coworker type

This commit is contained in:
michel 2017-12-04 11:22:45 +01:00
parent 97192b2a3c
commit 32f8dd52ea

View File

@ -50,6 +50,22 @@ 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.assertEqual(homer.coworker_type, False)
# self.homer.write({'is_coworker': False})
# self.assertEqual(self.homer.coworker_type, 'False')
#
# self.homer.write({'coworker_type': 'worker'})
# self.assertEqual(self.homer.coworker_type, u'Worker')
# self.homer.write({'coworker_type': 'member'})
# self.assertEqual(self.homer.coworker_type, u'Member')
# self.homer.write({'coworker_type': 'volunteer'})
# self.assertEqual(self.homer.coworker_type, u'Volunteer')
# self.homer.write({'coworker_type': 'visitor'})
# self.assertEqual(self.homer.coworker_type, u'visitor')
pass
# with self.assertRaises(ValidationError) as err:
# data = {'is_coworker': True, 'coworker_type': False}
# self.env['res.partner'].create(data)
# self.assertIn('Coworker type is required', unicode(err.exception))