Probablement un début de compréntion plus précise :)
This commit is contained in:
parent
3cf2ff0ebc
commit
611dc6f5f4
|
@ -15,10 +15,6 @@ class TestCoworkingCoworker(TransactionCase):
|
||||||
super(TestCoworkingCoworker, self).setUp(*args, **kwargs)
|
super(TestCoworkingCoworker, self).setUp(*args, **kwargs)
|
||||||
data = {'name': 'Homer Simpson', 'is_coworker': True}
|
data = {'name': 'Homer Simpson', 'is_coworker': True}
|
||||||
self.homer = self.env['res.partner'].create(data)
|
self.homer = self.env['res.partner'].create(data)
|
||||||
fulladdr = {'street': '26 rue de la concorde', 'contact_zip': '87452',
|
|
||||||
'city': 'Lyon'}
|
|
||||||
self.rue = self.env['res.partner'].create(fulladdr)
|
|
||||||
|
|
||||||
|
|
||||||
def test_contact_date(self):
|
def test_contact_date(self):
|
||||||
""" Test contact date : default to today and validity """
|
""" Test contact date : default to today and validity """
|
||||||
|
@ -36,12 +32,23 @@ class TestCoworkingCoworker(TransactionCase):
|
||||||
|
|
||||||
def test_full_address(self):
|
def test_full_address(self):
|
||||||
""" Test full address rendering """
|
""" Test full address rendering """
|
||||||
full_contact_adress = fields.Char.from_string(self.rue.full_contact_adress)
|
full_contact_adress = fields.from_string(self.homer.full_contact_adress)
|
||||||
self.assertEqual(full_contact_adress)
|
self.assertEqual(full_contact_adress, {full_contact_adress = u'{} {} {}'.format \
|
||||||
|
(street or u'', contact_zip or u'', city or u'').strip()})
|
||||||
|
|
||||||
|
fulladdr = self.env{'street': '29 Grande rue',
|
||||||
|
'contact_zip': '26270',
|
||||||
|
'city': 'Loriol'}
|
||||||
|
|
||||||
|
self.assertEqual(fulladdr.full_contact_adress, '29 Grande rue 26270 Loriol')
|
||||||
|
|
||||||
|
with self.assertRaises(ValidationError) as err:
|
||||||
|
fulladdr = {'street': '29 Grande rue',
|
||||||
|
'contact_zip': '26270',
|
||||||
|
'city': 'Loriol'}
|
||||||
|
self.env['coworking.coworker'].create(fulladdr)
|
||||||
|
self.assertIn('No full address valide', unicode(err.exception))
|
||||||
|
|
||||||
address = self.env['coworking.coworker'].create({
|
|
||||||
'street': '29 Grande rue', 'contact_zip': '26270', 'city': 'Loriol'})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def test_manage_coworker_type(self):
|
def test_manage_coworker_type(self):
|
||||||
|
|
Loading…
Reference in New Issue