Skip to content

Commit

Permalink
[IMP] account_payment_sale: Remove dependancies on demo data on tests
Browse files Browse the repository at this point in the history
  • Loading branch information
etobella committed Jan 15, 2025
1 parent 6d8e5d2 commit 542f4e6
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
18 changes: 16 additions & 2 deletions account_payment_sale/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,22 @@ def setUpClass(cls):
}
)
cls.products = {
"prod_order": cls.env.ref("product.product_order_01"),
"prod_del": cls.env.ref("product.product_delivery_01"),
"prod_order": cls.env["product.product"].create(
{
"name": "Test product order",
"detailed_type": "consu",
"list_price": 280,
"standard_price": 235,
}
),
"prod_del": cls.env["product.product"].create(
{
"name": "Test product delivery",
"detailed_type": "consu",
"list_price": 70,
"standard_price": 55,
}
),
"serv_order": cls.env["product.product"].create(
{
"name": "Test service product order",
Expand Down
19 changes: 17 additions & 2 deletions account_payment_sale/tests/test_sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,14 @@ def test_sale_to_invoice_payment_mode_via_payment(self):
{
"advance_payment_method": "fixed",
"fixed_amount": 5,
"product_id": self.env.ref("sale.advance_product_0").id,
"product_id": self.env["product.product"]
.create(
{
"name": "Deposit",
"type": "service",
}
)
.id,
"sale_order_ids": order,
}
)
Expand All @@ -113,7 +120,15 @@ def test_several_sale_to_invoice_payment_mode(self):
Expected result:
Two invoices should be generated
"""
payment_mode_2 = self.env.ref("account_payment_mode.payment_mode_outbound_dd1")
payment_mode_2 = self.env["account.payment.mode"].create(
{
"name": "Direct Debit of suppliers from Société Générale",
"bank_account_link": "variable",
"payment_method_id": self.env.ref(
"account.account_payment_method_manual_out"
).id,
}
)
order_1 = self.create_sale_order()
order_2 = self.create_sale_order(payment_mode_2)
orders = order_1 | order_2
Expand Down

0 comments on commit 542f4e6

Please sign in to comment.