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 11:35:05 +01:00
commit 38ad9c7a9c

View File

@ -31,7 +31,7 @@ class TestCoworkingCoworker(TransactionCase):
self.assertIn('equal of inferior to', unicode(err.exception))
def test_full_address(self):
""" Test full address rendering """
"""Test full address"""
self.homer.write({'street': False, 'zip': False, 'city': False})
self.assertEqual(self.homer.full_contact_adress, u'')
@ -42,8 +42,7 @@ class TestCoworkingCoworker(TransactionCase):
self.assertEqual(self.homer.full_contact_adress, u'5555 Springfield')
self.homer.write({'street': u'42 Liberty Street', 'zip': u'5555', 'city': u'Springfield'})
self.assertEqual(self.homer.full_contact_adress,
u'42 Liberty Street 5555 Springfield')
self.assertEqual(self.homer.full_contact_adress, u'42 Liberty Street 5555 Springfield')
self.homer.write({'street': u'42 Liberty Street', 'zip': False, 'city': u'Springfield'})
self.assertEqual(self.homer.full_contact_adress, u'42 Liberty Street Springfield')
@ -51,4 +50,10 @@ class TestCoworkingCoworker(TransactionCase):
def test_manage_coworker_type(self):
""" Test that non-coworker have not coworker_type fixed """
pass
homer = self.env['res.partner'].create({'name': 'Homer Simpson', 'is_coworker': False})
self.assertEqual(homer.coworker_type, False)
#
# 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))