Debut des test relation sur check_if_coworker_is_same
This commit is contained in:
parent
34efb13093
commit
0e5b176930
@ -12,9 +12,9 @@ class TestCoworkingEvent(TransactionCase):
|
|||||||
|
|
||||||
def setUp(self, *args, **kwargs):
|
def setUp(self, *args, **kwargs):
|
||||||
""" Bootstrap testing """
|
""" Bootstrap testing """
|
||||||
super(TestCoworkingCoworker, self).setUp(*args, **kwargs)
|
super(TestCoworkingEvent, self).setUp(*args, **kwargs)
|
||||||
data = {'name': 'Homer Simpson', '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
|
||||||
|
3
coworking_relation/tests/__init__.py
Normal file
3
coworking_relation/tests/__init__.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from . import test_coworking_relation
|
24
coworking_relation/tests/test_coworking_relation.py
Normal file
24
coworking_relation/tests/test_coworking_relation.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# -*- 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 and coworker2 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})
|
||||||
|
self.assertNotEqual('coworker1', 'coworker2')
|
||||||
|
|
||||||
|
with self.assertRaises(ValidationError) as err:
|
||||||
|
coworker1 = self.env['res.partner'].create({'name': 'Marge Simpson', 'is_coworker': True})
|
||||||
|
coworker2 = self.env['res.partner'].create({'name': 'Bart Simpson', 'is_coworker': True})
|
||||||
|
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