You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
955 B

  1. # -*- coding: utf-8 -*-
  2. # (c) 2015 ACSONE SA/NV, Dhinesh D
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. import threading
  5. from openerp.tests import common
  6. import openerp
  7. class TestIrConfigParameter(common.TransactionCase):
  8. def setUp(self):
  9. super(TestIrConfigParameter, self).setUp()
  10. self.db = openerp.tools.config['db_name']
  11. if not self.db and hasattr(threading.current_thread(), 'dbname'):
  12. self.db = threading.current_thread().dbname
  13. self.param_obj = self.env['ir.config_parameter']
  14. self.data_obj = self.env['ir.model.data']
  15. self.delay = self.env.ref(
  16. 'auth_session_timeout.inactive_session_time_out_delay')
  17. def test_check_delay(self):
  18. delay, urls = self.param_obj.get_session_parameters(self.db)
  19. self.assertEqual(delay, int(self.delay.value))
  20. self.assertIsInstance(delay, int)
  21. self.assertIsInstance(urls, list)