[REF] - code refactoring + improve unit tests

This commit is contained in:
sbejaoui
2020-05-15 19:51:00 +02:00
parent ebd1ed9fa3
commit dd5775e7d4
2 changed files with 60 additions and 35 deletions

View File

@@ -1,6 +1,7 @@
# Copyright 2018 ACSONE SA/NV.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields
from odoo.tests.common import TransactionCase
@@ -306,7 +307,7 @@ class TestProductTemplate(TransactionCase):
),
),
(
0.032,
1.0,
(
"Case 18",
"monthly",
@@ -315,7 +316,7 @@ class TestProductTemplate(TransactionCase):
to_date("2017-02-15"),
to_date("2018-01-01"),
False,
to_date("2018-01-30"),
to_date("2017-12-31"),
),
),
(
@@ -331,19 +332,6 @@ class TestProductTemplate(TransactionCase):
to_date("2018-01-30"),
),
),
(
1.0,
(
"Case 18",
"monthlylastday",
1,
"pre-paid",
to_date("2017-02-15"),
to_date("2018-01-31"),
False,
to_date("2017-12-31"),
),
),
(
1.566,
(
@@ -380,6 +368,30 @@ class TestProductTemplate(TransactionCase):
False,
),
),
(
1,
(
"Case 22",
"monthlylastday",
1,
"pre-paid",
to_date("2018-03-01"),
to_date("2018-03-01"),
False,
),
),
(
0.5,
(
"Case 23",
"monthlylastday",
1,
"pre-paid",
to_date("2018-04-16"),
to_date("2018-04-16"),
False,
),
),
]
for result, combination in combinations:
update_contract_line(*combination)