From 3a3e5c826ce786f8ca61b587da9f1723500926bb Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Fri, 28 Sep 2012 19:41:09 +0200 Subject: [PATCH] [WIP] start writing some simple tests for portal_crm bzr revid: abo@openerp.com-20120928174109-q8z9w71oj27n0s56 --- addons/portal_crm/__openerp__.py | 5 ++++- addons/portal_crm/test/submit_contact_form.yml | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 addons/portal_crm/test/submit_contact_form.yml diff --git a/addons/portal_crm/__openerp__.py b/addons/portal_crm/__openerp__.py index 81b6815b942..102ec36bb42 100644 --- a/addons/portal_crm/__openerp__.py +++ b/addons/portal_crm/__openerp__.py @@ -27,11 +27,14 @@ 'complexity': 'easy', 'description': """ This module adds a contact page (with a contact form creating a lead when submitted) to your portal if crm and portal are installed. -==================================================================================================================================== +==================================================================================================================================== """, 'author': 'OpenERP SA', 'depends': ['crm','portal'], 'data': ['wizard/contact_view.xml'], + 'test': [ + 'test/submit_contact_form.yml', + ], 'installable': True, 'auto_install': True, 'category': 'Hidden', diff --git a/addons/portal_crm/test/submit_contact_form.yml b/addons/portal_crm/test/submit_contact_form.yml new file mode 100644 index 00000000000..026d2c76c11 --- /dev/null +++ b/addons/portal_crm/test/submit_contact_form.yml @@ -0,0 +1,12 @@ +- + As a portal user, I fill in the contact form and submit it +- + !python {model: portal_crm.crm_contact_us}: | + values = { + 'name': 'Need information about your products', + 'partner_name': 'Mr. John Doe', + 'email_from': 'mister@john.doe', + 'phone': '+32 444 11 22 33', + 'description': 'Dear Sir or Madam, could you get back to me asap ? Regards.' + } + self.create(cr, ref("portal.demo_user0"), values, context=context) \ No newline at end of file