* run tours as public users since these screens should be accessible to and used by public users * fix access rights issues in website_crm tour (default value of team_id when creating a crm.lead requiring read access on crm.team, which the public user does not have) * remove duplicated crm.lead field (phone declared as char(size=64) then as char() a few lines below, removed first instance)
18 lines
837 B
Python
18 lines
837 B
Python
from openerp.api import Environment
|
|
import openerp.tests
|
|
@openerp.tests.common.at_install(False)
|
|
@openerp.tests.common.post_install(True)
|
|
class TestWebsiteCrm(openerp.tests.HttpCase):
|
|
def test_tour(self):
|
|
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('website_crm_tour', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.website_crm_tour")
|
|
|
|
# need environment using the test cursor as it's not committed
|
|
cr = self.registry.cursor()
|
|
assert cr is self.registry.test_cr
|
|
env = Environment(cr, self.uid, {})
|
|
record = env['crm.lead'].search([('description', '=', '### TOUR DATA ###')])
|
|
assert len(record) == 1
|
|
assert record.contact_name == 'John Smith'
|
|
assert record.email_from == 'john@smith.com'
|
|
assert record.partner_name == 'Odoo S.A.'
|