[MERGE] merged trunk.
[odoo/odoo.git] / addons / crm_partner_assign / test / test_crm_partner_assign.yml
index a63741c..78b23f3 100644 (file)
   Now I click on Forward button.
 -
   !python {model: crm.lead.forward.to.partner}: |
+    from tools import config
     vals = {
        'name': 'email',
        'email_to': 'info@axelor.com',
        'email_from': 'Administrator <admin@openerp.com>',
-       'reply_to': 'sales_openerp@openerp.com'
+       'reply_to': 'sales_openerp@openerp.com',
+       'state': 'draft',
     }
     ids = self.create(cr, uid, vals, context={'active_id': ref('crm_lead_questionnaireonopenerp0'), 'active_model': 'crm.lead'})
-    try:
-      self.action_forward(cr, uid, [ids], context={'active_id': ref('crm_lead_questionnaireonopenerp0'), 'active_model': 'crm.lead'})
-    except Exception, e:
-      pass
+    host = config.get('smtp_user', '127.0.0.1')
+    assert config.get(host, True), 'SMTP not configured !'
+    self.action_forward(cr, uid, [ids], context={'active_id': ref('crm_lead_questionnaireonopenerp0'), 'active_model': 'crm.lead'})
+