Files
odoo_source/addons/pos_hr/tests/test_frontend.py
T
Antoine Prieels 3f138b9d3c [IMP] point_of_sale, pos_*: Enable HTTPS in POS
HTTPS had been disabled on SaaS to allow the use of the IoT Box that
had no valid SSL certificate. As of V13.0, IoT Boxes connected to
Enterprise DBs have a valid certificate. POS can then use HTTPS.

Nginx is configured to redirect all requests to `/pos/web` to HTTP,
so we change the POS URL to `/pos/ui`, except when using a Six
payment terminal as it only works in HTTP.

closes odoo/odoo#56933

Taskid: 2191878
X-original-commit: 8aee4992778fee5e2f146c4cff8b35e83c7f56b3
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2020-09-02 10:53:34 +00:00

54 lines
1.7 KiB
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import tools
from odoo.api import Environment
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT
from datetime import date, timedelta
from odoo.tests import Form, tagged, new_test_user
from odoo.addons.point_of_sale.tests.test_frontend import TestPointOfSaleHttpCommon
class TestPosHrHttpCommon(TestPointOfSaleHttpCommon):
def setUp(self):
super().setUp()
self.main_pos_config.write({"module_pos_hr": True})
# Admin employee
self.env.ref("hr.employee_admin").write(
{"name": "Mitchell Admin", "pin": False}
)
# User employee
emp1 = self.env.ref("hr.employee_han")
emp1_user = new_test_user(
self.env,
login="emp1_user",
groups="base.group_user",
name="Pos Employee1",
email="emp1_user@pos.com",
)
emp1.write({"name": "Pos Employee1", "pin": "2580", "user_id": emp1_user.id})
# Non-user employee
emp2 = self.env.ref("hr.employee_jve")
emp2.write({"name": "Pos Employee2", "pin": "1234"})
with Form(self.main_pos_config) as config:
config.employee_ids.add(emp1)
config.employee_ids.add(emp2)
@tagged("post_install", "-at_install")
class TestUi(TestPosHrHttpCommon):
def test_01_pos_hr_tour(self):
# open a session, the /pos/ui controller will redirect to it
self.main_pos_config.open_session_cb(check_coa=False)
self.start_tour(
"/pos/ui?config_id=%d" % self.main_pos_config.id,
"PosHrTour",
login="admin",
)