File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
22from . import test_auditlog
33from . import test_autovacuum
4+ from . import test_http
45from . import test_multi_company
Original file line number Diff line number Diff line change 1+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
2+ import logging
3+
4+ from odoo .tests .common import HttpCase , tagged
5+
6+
7+ @tagged ("post_install" , "-at_install" )
8+ class TestAuditlogHttp (HttpCase ):
9+ def test_read_only_cursor (self ):
10+ self .authenticate ("admin" , "admin" )
11+ rule = self .env ["auditlog.rule" ].create (
12+ {
13+ "name" : "res.partner" ,
14+ "model_id" : self .env .ref ("base.model_res_partner" ).id ,
15+ "log_read" : True ,
16+ "log_type" : "full" ,
17+ "state" : "subscribed" ,
18+ }
19+ )
20+ self .addCleanup (rule .unsubscribe )
21+ partner = self .env .ref ("base.partner_demo" )
22+ with self .assertNoLogs ("odoo" , level = logging .ERROR ):
23+ self .make_jsonrpc_request (
24+ "/web/dataset/call_kw" ,
25+ params = {
26+ "model" : "res.partner" ,
27+ "method" : "read" ,
28+ "args" : [partner .ids ],
29+ "kwargs" : {},
30+ },
31+ headers = {
32+ "Cookie" : f"session_id={ self .session .sid } ;" ,
33+ },
34+ )
You can’t perform that action at this time.
0 commit comments