[ADD] contract_auto: Automatic Payment For Contracts

This commit is contained in:
Dave Lasley
2017-05-05 13:43:25 -07:00
parent ea6f03d50a
commit 9d1ae5c100
17 changed files with 1027 additions and 7 deletions

View File

@@ -0,0 +1,51 @@
# -*- coding: utf-8 -*-
# Copyright 2017 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase
class TestAccountAnalyticContract(TransactionCase):
def setUp(self):
super(TestAccountAnalyticContract, self).setUp()
self.Model = self.env['account.analytic.contract']
def test_default_invoice_mail_template_id(self):
""" It should return a mail template associated with invoice. """
res = self.Model._default_invoice_mail_template_id()
self.assertEqual(
res.model, 'account.invoice',
)
def test_default_pay_retry_mail_template_id(self):
""" It should return a mail template associated with invoice. """
res = self.Model._default_pay_retry_mail_template_id()
self.assertEqual(
res.model, 'account.invoice',
)
def test_default_pay_fail_mail_template_id(self):
""" It should return a mail template associated with invoice. """
res = self.Model._default_pay_fail_mail_template_id()
self.assertEqual(
res.model, 'account.invoice',
)
def test_default_auto_pay_retries(self):
""" It should return an int. """
self.assertIsInstance(
self.Model._default_auto_pay_retries(), int,
)
def test_default_auto_pay_retry_hours(self):
""" It should return an int. """
self.assertIsInstance(
self.Model._default_auto_pay_retry_hours(), int,
)
def test_context_mail_templates(self):
""" It should return a dict. """
self.assertIsInstance(
self.Model._context_mail_templates(), dict,
)