This repository has been archived by the owner on Dec 17, 2024. It is now read-only.
forked from OCA/l10n-netherlands
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[11.0][IMP] l10n_nl_xaf_auditfile_export: ease extensions (OCA#182)
* Extract method to ease extensions * Add basic tests * Make filename field stored + code review * Add group in view for extra options
- Loading branch information
Showing
5 changed files
with
71 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from . import test_l10n_nl_xaf_auditfile_export |
51 changes: 51 additions & 0 deletions
51
l10n_nl_xaf_auditfile_export/tests/test_l10n_nl_xaf_auditfile_export.py
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Copyright 2018 Onestein (<http://www.onestein.eu>) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class TestXafAuditfileExport(TransactionCase): | ||
|
||
def test_01_default_values(self): | ||
''' Check that the default values are filled on creation ''' | ||
record = self.env['xaf.auditfile.export'].create({}) | ||
|
||
self.assertTrue(record) | ||
self.assertTrue(record.name) | ||
self.assertFalse(record.auditfile) | ||
self.assertTrue(record.auditfile_name) | ||
self.assertTrue(record.company_id) | ||
self.assertTrue(record.date_start) | ||
self.assertTrue(record.date_end) | ||
self.assertFalse(record.date_generated) | ||
self.assertTrue(record.fiscalyear_name) | ||
|
||
def test_02_export_success(self): | ||
''' Do a basic auditfile export ''' | ||
record = self.env['xaf.auditfile.export'].create({}) | ||
record.button_generate() | ||
|
||
self.assertTrue(record.name) | ||
self.assertTrue(record.auditfile) | ||
self.assertTrue(record.auditfile_name) | ||
self.assertTrue(record.company_id) | ||
self.assertTrue(record.date_start) | ||
self.assertTrue(record.date_end) | ||
self.assertTrue(record.date_generated) | ||
self.assertTrue(record.fiscalyear_name) | ||
|
||
def test_03_export_error(self): | ||
''' Failure to export an auditfile ''' | ||
record = self.env['xaf.auditfile.export'].create({}) | ||
record.company_id.country_id = False | ||
record.button_generate() | ||
|
||
self.assertTrue(record) | ||
self.assertTrue(record.name) | ||
self.assertFalse(record.auditfile) | ||
self.assertTrue(record.auditfile_name) | ||
self.assertTrue(record.company_id) | ||
self.assertTrue(record.date_start) | ||
self.assertTrue(record.date_end) | ||
self.assertTrue(record.date_generated) | ||
self.assertTrue(record.fiscalyear_name) |
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