Skip to content

Commit

Permalink
test (wip)
Browse files Browse the repository at this point in the history
  • Loading branch information
quoc-pn committed Nov 3, 2023
1 parent 2b89202 commit 81d5d88
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions base_export_async/tests/test_base_export_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ def test_export_csv(self):
params, self.env.ref("base_export_async.delay_export_mail_template"), True
)
new_mail = self.env["mail.mail"].search([]) - mails
new_attachment = self.env["ir.attachment"].search([]) - attachments
new_attachments = self.env["ir.attachment"].search([]) - attachments
self.assertEqual(len(new_mail), 1)
self.assertEqual(len(new_mail.attachment_ids), 1)
self.assertEqual(new_attachment.name, "res.partner.csv")
self.assertEqual(new_attachments[0].name, "res.partner.csv")

def test_export_xls(self):
"""Check that the export generate an attachment and email"""
Expand All @@ -80,10 +80,10 @@ def test_export_xls(self):
attachments = self.env["ir.attachment"].search([])
self.delay_export_obj.export(params, None, True)
new_mail = self.env["mail.mail"].search([]) - mails
new_attachment = self.env["ir.attachment"].search([]) - attachments
new_attachments = self.env["ir.attachment"].search([]) - attachments
self.assertEqual(len(new_mail), 1)
self.assertEqual(len(new_mail.attachment_ids), 1)
self.assertEqual(new_attachment.name, "res.partner.xls")
self.assertEqual(new_attachments[0].name, "res.partner.xls")

def test_cron_delete(self):
"""Check that cron delete attachment after TTL"""
Expand Down

0 comments on commit 81d5d88

Please sign in to comment.