Skip to content

Commit

Permalink
100% coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
astirpe committed Jul 26, 2018
1 parent 9b08689 commit f3229fc
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)

0 comments on commit f3229fc

Please sign in to comment.