diff --git a/l10n_nl_xaf_auditfile_export/tests/test_l10n_nl_xaf_auditfile_export.py b/l10n_nl_xaf_auditfile_export/tests/test_l10n_nl_xaf_auditfile_export.py index 51a991f2d..d39e3a7c9 100644 --- a/l10n_nl_xaf_auditfile_export/tests/test_l10n_nl_xaf_auditfile_export.py +++ b/l10n_nl_xaf_auditfile_export/tests/test_l10n_nl_xaf_auditfile_export.py @@ -20,7 +20,7 @@ def test_01_default_values(self): self.assertFalse(record.date_generated) self.assertTrue(record.fiscalyear_name) - def test_02_export(self): + def test_02_export_success(self): ''' Do a basic auditfile export ''' record = self.env['xaf.auditfile.export'].create({}) record.button_generate() @@ -33,3 +33,19 @@ def test_02_export(self): 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)