You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.1 KiB

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2017 LasLabs Inc.
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from odoo.tests.common import HttpCase
  5. from odoo.addons.website.models.website import slug
  6. class TestController(HttpCase):
  7. post_install = True
  8. at_install = False
  9. def test_template_view(self):
  10. """ It should respond with 200 status """
  11. contract = self.env.ref(
  12. 'website_portal_contract.'
  13. 'website_contract_template_default'
  14. )
  15. self.authenticate('admin', 'admin')
  16. response = self.url_open(
  17. '/contract/template/%s' % slug(contract)
  18. )
  19. self.assertEquals(
  20. response.getcode(),
  21. 200,
  22. )
  23. def test_portal_contract_view_tour(self):
  24. """ Tests contract view is correct """
  25. tour = "odoo.__DEBUG__.services['web_tour.tour']"
  26. self.phantom_js(
  27. url_path='/my/home',
  28. code="%s.run('test_contract_view')" % tour,
  29. ready="%s.tours.test_contract_view.ready" % tour,
  30. login='portal',
  31. )