From a600f20bbb990ff38d45676a32abd75b754c3548 Mon Sep 17 00:00:00 2001 From: michel Date: Tue, 5 Dec 2017 14:06:58 +0100 Subject: [PATCH] Test recuperation de l'erreur --- coworking_relation/tests/test_coworking_relation.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/coworking_relation/tests/test_coworking_relation.py b/coworking_relation/tests/test_coworking_relation.py index 1588a2a..525ccc9 100644 --- a/coworking_relation/tests/test_coworking_relation.py +++ b/coworking_relation/tests/test_coworking_relation.py @@ -11,7 +11,7 @@ class TestCoworkingRelation(TransactionCase): """ Coworking cowoker testing """ def test_if_coworker_is_same(self): - """ Test coworker1 and coworker2 is identical """ + """ 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', @@ -22,4 +22,8 @@ class TestCoworkingRelation(TransactionCase): '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))