Compare commits

...

21 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
007af79930 Code optimisé 2017-12-04 14:16:05 +01:00
176e5ce696 / 2017-12-04 12:29:37 +01:00
817665d782 Test avec is-coworker True et un coworker type.
Test avec is_coworker False et un coworker type qui donne false.
2017-12-04 12:29:14 +01:00
161dcdaafe Test avec True 2017-12-04 11:38:27 +01:00
9e40808da7 Defini homer comme non coworker et dit que le resultat de coworker-type est false 2017-12-04 11:32:09 +01:00
32f8dd52ea Debut du test coworker type 2017-12-04 11:22:45 +01:00
97192b2a3c / 2017-12-04 10:23:33 +01:00
8ffd023640 Test de full_adress OK 2017-12-04 10:20:50 +01:00
c6c518ff68 / 2017-11-30 19:46:20 +01:00
6685e4e369 Ajout du test d'erreurs 2017-11-30 19:45:58 +01:00
58d6dec996 Je n'ai pas modifié le with pour le moment et j'ai une syntax error sur mon full_address que je ne trouve pas. 2017-11-30 18:59:43 +01:00
525dda9f04 Suite 2017-11-30 18:39:33 +01:00
611dc6f5f4 Probablement un début de compréntion plus précise :) 2017-11-30 18:30:54 +01:00
3cf2ff0ebc Ajout de la variable address 2017-11-30 17:57:25 +01:00
521cccce69 Suite 2017-11-30 17:46:35 +01:00
e21d5b92f4 début du test sur full adress 2017-11-30 17:35:50 +01:00
6 changed files with 80 additions and 4 deletions

View File

@ -31,9 +31,30 @@ class TestCoworkingCoworker(TransactionCase):
self.assertIn('equal of inferior to', unicode(err.exception))
def test_full_address(self):
""" Test full address rendering """
pass
"""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')
def test_manage_coworker_type(self):
""" Test that non-coworker have not coworker_type fixed """
pass
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)

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))