Pedro M. Baeza
8 years ago
9 changed files with 64 additions and 70 deletions
-
1inactive_session_timeout/README.rst
-
4inactive_session_timeout/__init__.py
-
31inactive_session_timeout/__openerp__.py
-
8inactive_session_timeout/data/ir_config_parameter_data.xml
-
4inactive_session_timeout/models/__init__.py
-
26inactive_session_timeout/models/ir_config_parameter.py
-
26inactive_session_timeout/models/res_users.py
-
6inactive_session_timeout/tests/__init__.py
-
28inactive_session_timeout/tests/test_ir_config_parameter.py
@ -1,2 +1,6 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# (c) 2015 ACSONE SA/NV, Dhinesh D |
|||
|
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
|
|||
from . import models |
@ -1,3 +1,7 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# (c) 2015 ACSONE SA/NV, Dhinesh D |
|||
|
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
|
|||
from . import res_users |
|||
from . import ir_config_parameter |
@ -0,0 +1,6 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# (c) 2015 ACSONE SA/NV, Dhinesh D |
|||
|
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
|
|||
from . import test_ir_config_parameter |
@ -0,0 +1,28 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# (c) 2015 ACSONE SA/NV, Dhinesh D |
|||
|
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
|
|||
import threading |
|||
|
|||
from openerp.tests import common |
|||
import openerp |
|||
|
|||
|
|||
class TestIrConfigParameter(common.TransactionCase): |
|||
|
|||
def setUp(self): |
|||
super(TestIrConfigParameter, self).setUp() |
|||
self.db = openerp.tools.config['db_name'] |
|||
if not self.db and hasattr(threading.current_thread(), 'dbname'): |
|||
self.db = threading.current_thread().dbname |
|||
self.param_obj = self.env['ir.config_parameter'] |
|||
self.data_obj = self.env['ir.model.data'] |
|||
self.delay = self.env.ref( |
|||
'inactive_session_timeout.inactive_session_time_out_delay') |
|||
|
|||
def test_check_delay(self): |
|||
delay, urls = self.param_obj.get_session_parameters(self.db) |
|||
self.assertEqual(delay, int(self.delay.value)) |
|||
self.assertIsInstance(delay, int) |
|||
self.assertIsInstance(urls, list) |
Write
Preview
Loading…
Cancel
Save
Reference in new issue