Skip to content

Commit

Permalink
Merge PR OCA#2978 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Nov 4, 2024
2 parents 6b62ffb + d85a34c commit 96cb5d5
Showing 1 changed file with 10 additions and 19 deletions.
29 changes: 10 additions & 19 deletions web_responsive/tests/test_res_users.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,23 @@
# Copyright 2023 Taras Shabaranskyi
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from odoo.tests import new_test_user

from odoo.tests.common import TransactionCase
from odoo.addons.base.tests.common import BaseCommon


class TestResUsers(TransactionCase):
class TestResUsers(BaseCommon):
def test_compute_redirect_home(self):
record = self.env["res.users"].create(
record = new_test_user(self.env, login="jeant@mail.com")
self.assertFalse(record.is_redirect_home)
action = self.env["ir.actions.act_window"].create(
{
"action_id": False,
"is_redirect_home": False,
"name": "Jeant",
"login": "jeant@mail.com",
"password": "jeant@mail.com",
"name": "Test Action",
"type": "ir.actions.act_window",
"res_model": record._name,
}
)

record._compute_redirect_home()
self.assertFalse(record.is_redirect_home)

action_obj = self.env["ir.actions.actions"]
record.action_id = action_obj.create(
{"name": "Test Action", "type": "ir.actions.act_window"}
)
record._compute_redirect_home()
record.action_id = action.id
self.assertFalse(record.is_redirect_home)

record.action_id = False
record.is_redirect_home = True
record._compute_redirect_home()
self.assertTrue(record.is_redirect_home)

0 comments on commit 96cb5d5

Please sign in to comment.