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 19, 2024
1 parent b55e35c commit ba621b1
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ def test_create_invoice(self):
.filtered(lambda r: not r.exclude_from_invoice_tab)
)
for line in lines:
if line.sequence not in result:
continue

Check warning on line 110 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#L110

Added line #L110 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 @@ -187,5 +189,7 @@ def test_custom_grouping_by_sale_order_user(self):
80: ("order 3 line 2", False),
}
for line in invoice.invoice_line_ids.sorted("sequence"):
if line.sequence not in result:
continue

Check warning on line 193 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#L193

Added line #L193 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 ba621b1

Please sign in to comment.