Browse Source

add basic unit tests

pull/145/head
Charbel Jacquin 9 years ago
parent
commit
06c636f1db
  1. 3
      partner_relations/__openerp__.py
  2. 33
      partner_relations/test/test.yml

3
partner_relations/__openerp__.py

@ -29,6 +29,9 @@
"demo": [ "demo": [
"data/demo.xml", "data/demo.xml",
], ],
"test": [
"test/test.xml",
],
"data": [ "data": [
"view/res_partner_relation_all.xml", "view/res_partner_relation_all.xml",
'view/res_partner_relation.xml', 'view/res_partner_relation.xml',

33
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
Loading…
Cancel
Save