Compare commits

...

5 Commits

Author SHA1 Message Date
a600f20bbb Test recuperation de l'erreur 2017-12-05 14:06:58 +01:00
95dc6a23b6 Test relation 2017-12-05 12:46:36 +01:00
22134ca9ee / 2017-12-04 16:45:23 +01:00
0e5b176930 Debut des test relation sur check_if_coworker_is_same 2017-12-04 15:54:30 +01:00
34efb13093 Structure de test event 2017-12-04 14:52:48 +01:00
5 changed files with 56 additions and 1 deletions

View File

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import test_coworking_event

View File

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
""" Coworking cowoker testing module """
from datetime import date
from odoo import fields
from odoo.exceptions import ValidationError
from odoo.tests.common import TransactionCase
class TestCoworkingEvent(TransactionCase):
""" Coworking cowoker testing """
# def setUp(self, *args, **kwargs):
# """ Bootstrap testing """
# super(TestCoworkingEvent, self).setUp(*args, **kwargs)
# data = {'title': 'Mon evenement', 'is_coworker': True}
# self.homer = self.env['res.partner'].create(data)
def test_contact_date(self):
pass

View File

@ -29,5 +29,5 @@
'views/relation_menu.xml',
'views/relation_views.xml',
'views/res_partner_views.xml'],
'depends': ['coworking_coworker']
'depends': ['coworking_coworker', 'coworking_event']
}

View File

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import test_coworking_relation

View File

@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
""" Coworking cowoker testing module """
from datetime import date
from odoo import fields
from odoo.exceptions import ValidationError
from odoo.tests.common import TransactionCase
class TestCoworkingRelation(TransactionCase):
""" Coworking cowoker testing """
def test_if_coworker_is_same(self):
""" Test coworker1.id and coworker2.id is identical """
coworker1 = self.env['res.partner'].create({'name': 'Marge Simpson',
'is_coworker': True})
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.env['coworking.relation'].create({'coworker1': coworker1.id,
'coworker2': coworker1.id,
'relation': 'Mère'})
self.assertIn(u'Coworker1 is same coworker2', unicode(err.exception))