-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
1,137 additions
and
992 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
from odoo.tests.common import TransactionCase | ||
|
||
class TestAccountDebtReport(TransactionCase): | ||
|
||
class TestAccountDebtReport(TransactionCase): | ||
def setUp(self): | ||
super(TestAccountDebtReport, self).setUp() | ||
# Set up test data, e.g., a partner and invoices | ||
self.partner = self.env['res.partner'].create({ | ||
'name': 'Test Partner', | ||
'email': '[email protected]' | ||
}) | ||
self.partner = self.env["res.partner"].create({"name": "Test Partner", "email": "[email protected]"}) | ||
|
||
def test_debt_report_lines(self): | ||
# Execute the method and validate output | ||
|
@@ -17,26 +14,24 @@ def test_debt_report_lines(self): | |
self.assertIsInstance(report_lines, list, "Expected a list of report lines") | ||
if report_lines: | ||
first_line = report_lines[0] | ||
self.assertIn('date', first_line, "Report line should contain 'date'") | ||
self.assertIn('name', first_line, "Report line should contain 'name'") | ||
self.assertIn('balance', first_line, "Report line should contain 'balance'") | ||
self.assertIn("date", first_line, "Report line should contain 'date'") | ||
self.assertIn("name", first_line, "Report line should contain 'name'") | ||
self.assertIn("balance", first_line, "Report line should contain 'balance'") | ||
|
||
|
||
class TestAccountDebtReportWizard(TransactionCase): | ||
|
||
def setUp(self): | ||
super(TestAccountDebtReportWizard, self).setUp() | ||
# Crear un partner de prueba | ||
self.partner = self.env['res.partner'].create({ | ||
'name': 'Test Partner', | ||
'email': '[email protected]' | ||
}) | ||
self.partner = self.env["res.partner"].create({"name": "Test Partner", "email": "[email protected]"}) | ||
# Crear el wizard para el reporte de deuda | ||
self.wizard = self.env['account.debt.report.wizard'].create({ | ||
'company_id': self.env.company.id, | ||
'result_selection': 'all', | ||
'historical_full': True, | ||
}) | ||
self.wizard = self.env["account.debt.report.wizard"].create( | ||
{ | ||
"company_id": self.env.company.id, | ||
"result_selection": "all", | ||
"historical_full": True, | ||
} | ||
) | ||
|
||
def test_confirm_method(self): | ||
# Verificar que el método confirm se ejecuta correctamente | ||
|
@@ -47,4 +42,4 @@ def test_send_by_email_method(self): | |
# Verificar que el método send_by_email se ejecuta correctamente | ||
action = self.wizard.with_context(active_id=self.partner.id).send_by_email() | ||
self.assertTrue(action, "El método send_by_email debería retornar una acción de ventana") | ||
self.assertEqual(action['res_model'], 'mail.compose.message', "El modelo debería ser 'mail.compose.message'") | ||
self.assertEqual(action["res_model"], "mail.compose.message", "El modelo debería ser 'mail.compose.message'") |
Oops, something went wrong.