mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[10.0][ADD] Add website_portal_contract (#62)
* [ADD] Add website_portal_contract * [ADD] website_portal_contract: Add url test, usage video. * [FIX] website_portal_contract: Fix controller test. * [FIX] website_portal_contract: Change all tests to HttpCase.
This commit is contained in:
37
website_portal_contract/tests/test_controller.py
Normal file
37
website_portal_contract/tests/test_controller.py
Normal file
@@ -0,0 +1,37 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2017 LasLabs Inc.
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo.tests.common import HttpCase
|
||||
from odoo.addons.website.models.website import slug
|
||||
|
||||
|
||||
class TestController(HttpCase):
|
||||
|
||||
post_install = True
|
||||
at_install = False
|
||||
|
||||
def test_template_view(self):
|
||||
""" It should respond with 200 status """
|
||||
contract = self.env.ref(
|
||||
'website_portal_contract.'
|
||||
'website_contract_template_default'
|
||||
)
|
||||
self.authenticate('admin', 'admin')
|
||||
response = self.url_open(
|
||||
'/contract/template/%s' % slug(contract)
|
||||
)
|
||||
self.assertEquals(
|
||||
response.getcode(),
|
||||
200,
|
||||
)
|
||||
|
||||
def test_portal_contract_view_tour(self):
|
||||
""" Tests contract view is correct """
|
||||
tour = "odoo.__DEBUG__.services['web_tour.tour']"
|
||||
self.phantom_js(
|
||||
url_path='/my/home',
|
||||
code="%s.run('test_contract_view')" % tour,
|
||||
ready="%s.tours.test_contract_view.ready" % tour,
|
||||
login='portal',
|
||||
)
|
||||
Reference in New Issue
Block a user