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.

22 lines
905 B

  1. # © 2015 Therp BV <http://therp.nl>
  2. # © 2017 Avoin.Systems - Miku Laitinen
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from odoo.tools import mute_logger
  5. from odoo.tests.common import TransactionCase
  6. class TestDeadMansSwitchClient(TransactionCase):
  7. def test_dead_mans_switch_client(self):
  8. # test unconfigured case
  9. self.env['ir.config_parameter'].search([
  10. ('key', '=', 'dead_mans_switch_client.url')]).unlink()
  11. with mute_logger(
  12. 'odoo.addons.dead_mans_switch_client.models'
  13. '.dead_mans_switch_client'
  14. ):
  15. self.env['dead.mans.switch.client'].alive()
  16. # test configured case
  17. self.env['ir.config_parameter'].set_param(
  18. 'dead_mans_switch_client.url', 'fake_url')
  19. with self.assertRaises(ValueError):
  20. self.env['dead.mans.switch.client'].alive()