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.

51 lines
1.7 KiB

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2017 LasLabs Inc.
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from odoo.tests.common import TransactionCase
  5. class TestAccountAnalyticContract(TransactionCase):
  6. def setUp(self):
  7. super(TestAccountAnalyticContract, self).setUp()
  8. self.Model = self.env['account.analytic.contract']
  9. def test_default_invoice_mail_template_id(self):
  10. """ It should return a mail template associated with invoice. """
  11. res = self.Model._default_invoice_mail_template_id()
  12. self.assertEqual(
  13. res.model, 'account.invoice',
  14. )
  15. def test_default_pay_retry_mail_template_id(self):
  16. """ It should return a mail template associated with invoice. """
  17. res = self.Model._default_pay_retry_mail_template_id()
  18. self.assertEqual(
  19. res.model, 'account.invoice',
  20. )
  21. def test_default_pay_fail_mail_template_id(self):
  22. """ It should return a mail template associated with invoice. """
  23. res = self.Model._default_pay_fail_mail_template_id()
  24. self.assertEqual(
  25. res.model, 'account.invoice',
  26. )
  27. def test_default_auto_pay_retries(self):
  28. """ It should return an int. """
  29. self.assertIsInstance(
  30. self.Model._default_auto_pay_retries(), int,
  31. )
  32. def test_default_auto_pay_retry_hours(self):
  33. """ It should return an int. """
  34. self.assertIsInstance(
  35. self.Model._default_auto_pay_retry_hours(), int,
  36. )
  37. def test_context_mail_templates(self):
  38. """ It should return a dict. """
  39. self.assertIsInstance(
  40. self.Model._context_mail_templates(), dict,
  41. )