[ADD, IMP] crm_partner_assign: 1) Coverage,Improved and tested onchange on email...
authorron@tinyerp.com <>
Thu, 20 Oct 2011 05:23:51 +0000 (10:53 +0530)
committerron@tinyerp.com <>
Thu, 20 Oct 2011 05:23:51 +0000 (10:53 +0530)
2) Updated __openerp__.py

bzr revid: ron@tinyerp.com-20111020052351-elvtmn8yo8au2j2l

addons/crm_partner_assign/__openerp__.py
addons/crm_partner_assign/test/ui/partner_assign_form.yml

index cc993fe..0b9e14c 100644 (file)
@@ -46,7 +46,8 @@ You can also use the geolocalization without using the GPS coordinates.
         'report/crm_lead_report_view.xml',
         'report/crm_partner_report_view.xml',
     ],
-    'test': ['test/process/partner_assign.yml'],
+    'test': ['test/process/partner_assign.yml',
+             'test/ui/partner_assign_form.yml'],
     'installable': True,
     'active': False,
     'certificate': '00503409558942442061',
index e69de29..747297a 100644 (file)
@@ -0,0 +1,18 @@
+-
+  For onchange on partner , i assign an email address to Administrator user.
+-
+  !record {model: res.users, id: base.user_root}:
+    user_email: admin@openerp.com
+
+-
+  I check onchange on email, partner, history and test the data accordingly change.
+-
+  !python {model: crm.lead.forward.to.partner}: |
+    context.update({'history': 'latest', 'active_id': ref('crm.crm_case_abcfuelcounits0')})
+    email = self.on_change_email(cr, uid, [ref('crm.crm_case_abcfuelcounits0')], ref('base.user_root'))
+    assert email['value']['email_to'] == "Administrator <admin@openerp.com>", "Email is not correct"
+    partner = self.on_change_partner(cr, uid, [ref('crm.crm_case_abcfuelcounits0')], ref('base.res_partner_desertic_hispafuentes'))
+    assert partner['value']['address_id'] == ref('base.res_partner_desertic_hispafuentes'), "Address invalid"
+    assert partner['value']['email_to'] == 'info@axelor.com', "Email id incorrect"
+    history = self.on_change_history(cr, uid, [ref('crm.crm_case_abcfuelcounits0')], context.get('history'), context)
+    assert history, "History is blank"
\ No newline at end of file