Compare commits
No commits in common. "V5_unit_test" and "V4" have entirely different histories.
V5_unit_te
...
V4
@ -31,30 +31,9 @@ class TestCoworkingCoworker(TransactionCase):
|
||||
self.assertIn('equal of inferior to', unicode(err.exception))
|
||||
|
||||
def test_full_address(self):
|
||||
"""Test full address"""
|
||||
self.homer.write({'street': False, 'zip': False, 'city': False})
|
||||
self.assertEqual(self.homer.full_contact_adress, u'')
|
||||
|
||||
self.homer.write({'street': False, 'zip': False, 'city': u'Springfield'})
|
||||
self.assertEqual(self.homer.full_contact_adress, u'Springfield')
|
||||
|
||||
self.homer.write({'street': False, 'zip': u'5555', 'city': u'Springfield'})
|
||||
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.homer.write({'street': u'42 Liberty Street', 'zip': False, 'city': u'Springfield'})
|
||||
self.assertEqual(self.homer.full_contact_adress, u'42 Liberty Street Springfield')
|
||||
|
||||
""" Test full address rendering """
|
||||
pass
|
||||
|
||||
def test_manage_coworker_type(self):
|
||||
""" Test that non-coworker have not coworker_type fixed """
|
||||
self.homer.write({'is_coworker': False})
|
||||
self.assertFalse(self.homer.coworker_type)
|
||||
|
||||
self.homer.write({'coworker_type': 'visitor'})
|
||||
self.assertEqual(self.homer.coworker_type, 'visitor')
|
||||
|
||||
self.homer.write({'is_coworker': False, 'coworker_type': 'staffer'})
|
||||
self.assertFalse(self.homer.coworker_type)
|
||||
pass
|
||||
|
@ -1,3 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import test_coworking_event
|
@ -1,20 +0,0 @@
|
||||
# -*- 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
|
@ -29,5 +29,5 @@
|
||||
'views/relation_menu.xml',
|
||||
'views/relation_views.xml',
|
||||
'views/res_partner_views.xml'],
|
||||
'depends': ['coworking_coworker', 'coworking_event']
|
||||
'depends': ['coworking_coworker']
|
||||
}
|
||||
|
@ -1,3 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import test_coworking_relation
|
@ -1,29 +0,0 @@
|
||||
# -*- 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))
|
Loading…
x
Reference in New Issue
Block a user