Skip to content

Commit

Permalink
[FIX] account_invoice_section_sale_order: Avoid problems in integrati…
Browse files Browse the repository at this point in the history
…on tests

In OCA repo, now we have this error:

 Traceback (most recent call last):
  File "/__w/account-invoicing/account-invoicing/account_invoice_section_sale_order/tests/test_invoice_group_by_sale_order.py", line 109, in test_create_invoice
    self.assertEqual(line.name, result[line.sequence][0])
KeyError: 1
  • Loading branch information
pedrobaeza authored and sebalix committed Sep 26, 2024
1 parent b999748 commit 8cd1abd
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ def test_create_invoice(self):
invoice_ids = (self.order1_p1 + self.order2_p1)._create_invoices()
lines = invoice_ids[0].invoice_line_ids.sorted("sequence")
for line in lines:
if line.sequence not in result:
continue

Check warning on line 130 in account_invoice_section_sale_order/tests/test_invoice_group_by_sale_order.py

View check run for this annotation

Codecov / codecov/patch

account_invoice_section_sale_order/tests/test_invoice_group_by_sale_order.py#L130

Added line #L130 was not covered by tests
self.assertEqual(line.name, result[line.sequence][0])
self.assertEqual(line.display_type, result[line.sequence][1])

Expand Down Expand Up @@ -204,5 +206,7 @@ def test_custom_grouping_by_sale_order_user(self):
100: ("order 3 line 2", "product"),
}
for line in invoice.invoice_line_ids.sorted("sequence"):
if line.sequence not in result:
continue

Check warning on line 210 in account_invoice_section_sale_order/tests/test_invoice_group_by_sale_order.py

View check run for this annotation

Codecov / codecov/patch

account_invoice_section_sale_order/tests/test_invoice_group_by_sale_order.py#L210

Added line #L210 was not covered by tests
self.assertEqual(line.name, result[line.sequence][0])
self.assertEqual(line.display_type, result[line.sequence][1])

0 comments on commit 8cd1abd

Please sign in to comment.