def METHOD_NAME(self):
    """Check that the export generate an attachment and email"""
    params = json.loads(data_xls.get("data"))
    mails = self.env["mail.mail"].search([])
    attachments = self.env["ir.attachment"].search([])
    with patch.object(ExcelExport, "from_data", return_value=b"\x41\x42\x43\x44"):
        self.delay_export_obj.export(params)
    new_mail = self.env["mail.mail"].search([]) - mails
    new_attachment = self.env["ir.attachment"].search([]) - attachments
    self.assertEqual(len(new_mail), 1)
    self.assertEqual(new_attachment.name, "res.partner.xls")