From c692338e6b8a9ba1c3ffb497e82f84e789eb3765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20L=C3=B3pez?= Date: Fri, 10 Nov 2017 05:08:00 +0000 Subject: [PATCH] =?UTF-8?q?[FIX]=C2=A0contract=5Fpayment=5Fauto:=20Fix=20f?= =?UTF-8?q?reze=20wkhtmltopdf=20freezed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tests/test_contract_payment.py | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/contract_payment_mode/tests/test_contract_payment.py b/contract_payment_mode/tests/test_contract_payment.py index c3fc3e0d..d5580081 100644 --- a/contract_payment_mode/tests/test_contract_payment.py +++ b/contract_payment_mode/tests/test_contract_payment.py @@ -4,42 +4,44 @@ # Copyright 2017 Tecnativa - David Vidal # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo.tests import common +import odoo.tests from ..hooks import post_init_hook -class TestContractPaymentInit(common.SavepointCase): - @classmethod - def setUpClass(cls): - super(TestContractPaymentInit, cls).setUpClass() +@odoo.tests.post_install(True) +@odoo.tests.at_install(False) +class TestContractPaymentInit(odoo.tests.HttpCase): - cls.payment_method = cls.env['account.payment.method'].create({ + def setUp(self): + super(TestContractPaymentInit, self).setUp() + + self.payment_method = self.env['account.payment.method'].create({ 'name': 'Test Payment Method', 'code': 'Test', 'payment_type': 'inbound', }) - cls.payment_mode = cls.env['account.payment.mode'].create({ + self.payment_mode = self.env['account.payment.mode'].create({ 'name': 'Test payment mode', 'active': True, - 'payment_method_id': cls.payment_method.id, + 'payment_method_id': self.payment_method.id, 'bank_account_link': 'variable', }) - cls.partner = cls.env['res.partner'].create({ + self.partner = self.env['res.partner'].create({ 'name': 'Test contract partner', - 'customer_payment_mode_id': cls.payment_mode, + 'customer_payment_mode_id': self.payment_mode, }) - cls.product = cls.env['product.product'].create({ + self.product = self.env['product.product'].create({ 'name': 'Custom Service', 'type': 'service', - 'uom_id': cls.env.ref('product.product_uom_hour').id, - 'uom_po_id': cls.env.ref('product.product_uom_hour').id, + 'uom_id': self.env.ref('product.product_uom_hour').id, + 'uom_po_id': self.env.ref('product.product_uom_hour').id, 'sale_ok': True, }) - cls.contract = cls.env['account.analytic.account'].create({ + self.contract = self.env['account.analytic.account'].create({ 'name': 'Maintenance of Servers', }) - company = cls.env.ref('base.main_company') - cls.journal = cls.env['account.journal'].create({ + company = self.env.ref('base.main_company') + self.journal = self.env['account.journal'].create({ 'name': 'Sale Journal - Test', 'code': 'HRTSJ', 'type': 'sale',