Test relation
This commit is contained in:
parent
22134ca9ee
commit
95dc6a23b6
@ -10,11 +10,11 @@ from odoo.tests.common import TransactionCase
|
|||||||
class TestCoworkingEvent(TransactionCase):
|
class TestCoworkingEvent(TransactionCase):
|
||||||
""" Coworking cowoker testing """
|
""" Coworking cowoker testing """
|
||||||
|
|
||||||
def setUp(self, *args, **kwargs):
|
# def setUp(self, *args, **kwargs):
|
||||||
""" Bootstrap testing """
|
# """ Bootstrap testing """
|
||||||
super(TestCoworkingEvent, self).setUp(*args, **kwargs)
|
# super(TestCoworkingEvent, self).setUp(*args, **kwargs)
|
||||||
data = {'title': 'Mon evenement', 'is_coworker': True}
|
# data = {'title': 'Mon evenement', 'is_coworker': True}
|
||||||
self.homer = self.env['res.partner'].create(data)
|
# self.homer = self.env['res.partner'].create(data)
|
||||||
|
|
||||||
def test_contact_date(self):
|
def test_contact_date(self):
|
||||||
pass
|
pass
|
||||||
|
@ -29,5 +29,5 @@
|
|||||||
'views/relation_menu.xml',
|
'views/relation_menu.xml',
|
||||||
'views/relation_views.xml',
|
'views/relation_views.xml',
|
||||||
'views/res_partner_views.xml'],
|
'views/res_partner_views.xml'],
|
||||||
'depends': ['coworking_coworker']
|
'depends': ['coworking_coworker', 'coworking_event']
|
||||||
}
|
}
|
||||||
|
@ -12,11 +12,14 @@ class TestCoworkingRelation(TransactionCase):
|
|||||||
|
|
||||||
def test_if_coworker_is_same(self):
|
def test_if_coworker_is_same(self):
|
||||||
""" Test coworker1 and coworker2 is identical """
|
""" Test coworker1 and coworker2 is identical """
|
||||||
coworker1 = self.env['res.partner'].create({'name': 'Marge Simpson', 'is_coworker': True})
|
coworker1 = self.env['res.partner'].create({'name': 'Marge Simpson',
|
||||||
coworker2 = self.env['res.partner'].create({'name': 'Bart Simpson', 'is_coworker': True})
|
'is_coworker': True})
|
||||||
self.assertNotEqual('coworker1', 'coworker2')
|
coworker2 = self.env['res.partner'].create({'name': 'Bart Simpson',
|
||||||
|
'is_coworker': True})
|
||||||
|
|
||||||
|
relation = self.env['coworking.relation'].create({'coworker1': coworker1.id,
|
||||||
|
'coworker2': coworker2.id,
|
||||||
|
'relation': 'Mère'})
|
||||||
|
self.assertEqual(relation.relation, u'Mère')
|
||||||
|
|
||||||
|
|
||||||
with self.assertRaises(ValidationError) as err:
|
|
||||||
self.assertEqual('coworker1', 'coworker2')
|
|
||||||
self.env['res.partner'].create(coworker1, coworker2)
|
|
||||||
self.assertIn('Coworker1 is same coworker2', unicode(err.exception))
|
|
||||||
|
Loading…
Reference in New Issue
Block a user