Skip to content

Commit

Permalink
Add basic tests
Browse files Browse the repository at this point in the history
  • Loading branch information
astirpe committed Jul 27, 2018
1 parent d6c6ad7 commit caf2725
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
3 changes: 3 additions & 0 deletions l10n_nl_xaf_auditfile_export/tests/__init__.py
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
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)

0 comments on commit caf2725

Please sign in to comment.