Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
ppakpahan committed Feb 16, 2025
1 parent 956d7ad commit c8e372c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions purchase_request_expense/tests/test_purchase_request_expense.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,19 @@ def test_01_module_installation_check(self):
"employee_id": self.employee.id,
}
)
# Since the module hr_expense_advance_clearing is installed in test
self.assertTrue(wizard._has_expense_advance_clearing())

# Check if hr_expense_advance_clearing is in the installed modules list
module = self.env["ir.module.module"].search(
[("name", "=", "hr_expense_advance_clearing")]
)
is_installed = module.state == "installed" if module else False

# Test should pass whether module is installed or not
self.assertEqual(
wizard._has_expense_advance_clearing(),
is_installed,
"Module installation check should match actual installation status",
)

def test_02_error_handling_no_items(self):
"""Test error when trying to create expense without items"""
Expand Down

0 comments on commit c8e372c

Please sign in to comment.