Skip to content

Commit

Permalink
[REF] l10n_br_account: tests don't depend on demo
Browse files Browse the repository at this point in the history
  • Loading branch information
rvalyi committed Dec 29, 2024
1 parent 257c2e5 commit 5e6dfdb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
6 changes: 3 additions & 3 deletions l10n_br_account/tests/test_document_date.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
from odoo.tests import TransactionCase

from odoo.addons.l10n_br_fiscal.constants.fiscal import DOCUMENT_ISSUER_PARTNER
from odoo.addons.l10n_br_fiscal.tests.tools import load_fiscal_fixture_files


class TestInvoiceDiscount(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
load_fiscal_fixture_files(cls.env)
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
cls.company = cls.env.ref("l10n_br_base.empresa_lucro_presumido")

Expand Down Expand Up @@ -53,15 +55,13 @@ def setUpClass(cls):
cls.fiscal_operation_id = cls.env.ref("l10n_br_fiscal.fo_venda")
cls.fiscal_operation_id.deductible_taxes = True

product_id = cls.env.ref("product.product_product_7")

invoice_line_vals = [
(
0,
0,
{
"account_id": cls.invoice_line_account_id.id,
"product_id": product_id.id,
"name": "some product",
"quantity": 1,
"price_unit": 1000.0,
"discount_value": 100.0,
Expand Down
6 changes: 3 additions & 3 deletions l10n_br_account/tests/test_invoice_refund.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
from odoo.exceptions import UserError
from odoo.tests import TransactionCase

from odoo.addons.l10n_br_fiscal.tests.tools import load_fiscal_fixture_files


class TestInvoiceRefund(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
load_fiscal_fixture_files(cls.env)
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))

cls.sale_account = cls.env["account.account"].create(
Expand Down Expand Up @@ -41,9 +44,6 @@ def setUpClass(cls):
dict(
name="Test Refund Invoice",
move_type="out_invoice",
invoice_payment_term_id=cls.env.ref(
"account.account_payment_term_advance"
).id,
partner_id=cls.env.ref("l10n_br_base.res_partner_cliente1_sp").id,
journal_id=cls.refund_journal.id,
document_type_id=cls.env.ref("l10n_br_fiscal.document_55").id,
Expand Down
13 changes: 6 additions & 7 deletions l10n_br_account/tests/test_move_discount.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@

from odoo.tests import TransactionCase

from odoo.addons.l10n_br_base.tests.tools import load_fixture_files


class TestInvoiceDiscount(TransactionCase):
def setUp(self):
super().setUp()

load_fixture_files(
self.env, "l10n_br_base", file_names=["res_company_demo.xml"]
)
self.company = self.env.ref("l10n_br_base.empresa_lucro_presumido")

# set default user company
Expand Down Expand Up @@ -46,15 +50,13 @@ def setUp(self):
self.fiscal_operation_id = self.env.ref("l10n_br_fiscal.fo_venda")
self.fiscal_operation_id.deductible_taxes = True

product_id = self.env.ref("product.product_product_7")

invoice_line_vals = [
(
0,
0,
{
"account_id": self.invoice_line_account_id.id,
"product_id": product_id.id,
"name": "some product",
"quantity": 1,
"price_unit": 1000.0,
"discount_value": 100.0,
Expand All @@ -68,9 +70,6 @@ def setUp(self):
.create(
{
"company_id": self.company.id,
"document_serie_id": self.env.ref(
"l10n_br_fiscal.empresa_lc_document_55_serie_1"
).id,
"journal_id": self.invoice_journal.id,
"invoice_user_id": self.env.user.id,
"fiscal_operation_id": self.fiscal_operation_id.id,
Expand Down
4 changes: 3 additions & 1 deletion l10n_br_account/tests/test_non_fiscal_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

from odoo.tests import TransactionCase

from odoo.addons.l10n_br_base.tests.tools import load_fixture_files


class TestCustomerInvoice(TransactionCase):
"""
Expand All @@ -14,6 +16,7 @@ class TestCustomerInvoice(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
load_fixture_files(cls.env, "base", file_names=["data/res_partner_demo.xml"])
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))

cls.sale_account = cls.env["account.account"].create(
Expand Down Expand Up @@ -52,7 +55,6 @@ def setUpClass(cls):
0,
0,
{
"product_id": cls.env.ref("product.product_product_5").id,
"quantity": 10.0,
"price_unit": 450.0,
"account_id": cls.env["account.account"]
Expand Down

0 comments on commit 5e6dfdb

Please sign in to comment.