From 06c636f1db780f27c323f028aac64e637af60bd4 Mon Sep 17 00:00:00 2001 From: Charbel Jacquin Date: Wed, 29 Jul 2015 14:58:08 +0200 Subject: [PATCH] add basic unit tests --- partner_relations/__openerp__.py | 3 +++ partner_relations/test/test.yml | 33 ++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 partner_relations/test/test.yml diff --git a/partner_relations/__openerp__.py b/partner_relations/__openerp__.py index c7e3775b9..d4450f413 100644 --- a/partner_relations/__openerp__.py +++ b/partner_relations/__openerp__.py @@ -29,6 +29,9 @@ "demo": [ "data/demo.xml", ], + "test": [ + "test/test.xml", + ], "data": [ "view/res_partner_relation_all.xml", 'view/res_partner_relation.xml', diff --git a/partner_relations/test/test.yml b/partner_relations/test/test.yml new file mode 100644 index 000000000..fee8a3324 --- /dev/null +++ b/partner_relations/test/test.yml @@ -0,0 +1,33 @@ +- + I create a relation type allowing partners to be in + both sides of the relation. +- + !record {model: res.partner.relation.type, id: allow_self}: + name: 'Relation A' + name_inverse: 'Inverse Relation A' + contact_type_right: 'p' + contact_type_left: 'p' + allow_self: True +- + I create a relation type with default value for `allow_self` + both sides of the relation. +- + !record {model: res.partner.relation.type, id: allow_self}: + name: 'Relation B' + name_inverse: 'Inverse Relation B' + contact_type_right: 'p' + contact_type_left: 'p' +- + I create relation instance admin -- Relation A --> admin +- + !record {model: res.partner.relation, id: test_allow}: + left_partner_id: base.admin + right_partner_id: base.admin + type_id: test_allow +- + I create relation instance admin -- Relation B --> admin +- + !record {model: res.partner.relation, id: test_disallow}: + left_partner_id: base.admin + right_partner_id: base.admin + type_id: test_disallow