mirror of
https://github.com/bringout/oca-ocb-security.git
synced 2026-04-19 19:32:08 +02:00
19.0 vanilla
This commit is contained in:
parent
20ddc1b4a3
commit
c0efcc53f5
1162 changed files with 125577 additions and 105287 deletions
|
|
@ -4,7 +4,6 @@ from unittest.mock import patch
|
|||
|
||||
import odoo
|
||||
from odoo.modules.registry import Registry, DummyRLock
|
||||
from odoo.tests import HOST
|
||||
from odoo.tests.common import BaseCase, tagged, get_db_name
|
||||
|
||||
|
||||
|
|
@ -13,7 +12,7 @@ class TestAuthLDAP(BaseCase):
|
|||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
cls.registry = odoo.registry(get_db_name())
|
||||
cls.registry = Registry(get_db_name())
|
||||
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
|
|
@ -58,15 +57,13 @@ class TestAuthLDAP(BaseCase):
|
|||
cr.execute("SELECT id FROM res_users WHERE login = 'test_ldap_user'")
|
||||
self.assertFalse(cr.rowcount, "User should not be present")
|
||||
|
||||
body = self.opener.get(
|
||||
f"http://{HOST}:{odoo.tools.config['http_port']}/web/login"
|
||||
).text
|
||||
body = self.url_open("/web/login").text
|
||||
csrf = re.search(r'csrf_token: "(\w*?)"', body).group(1)
|
||||
|
||||
with patch.object(self.registry["res.company.ldap"], "_get_ldap_dicts", _get_ldap_dicts),\
|
||||
patch.object(self.registry["res.company.ldap"], "_authenticate", _authenticate):
|
||||
res = self.opener.post(
|
||||
f"http://{HOST}:{odoo.tools.config['http_port']}/web/login",
|
||||
res = self.url_open(
|
||||
f"{self.base_url()}/web/login",
|
||||
data={
|
||||
"login": "test_ldap_user",
|
||||
"password": "test",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue