def METHOD_NAME(self):
    """Check that the shipping notification is sent to the right partner"""
    self.env.ref("delivery_state.delivery_notification").auto_delete = False
    self.sale.action_confirm()
    previous_mails = self.env["mail.mail"].search(
        [("partner_ids", "in", self.partner.ids)]
    )
    self.assertFalse(previous_mails)
    picking = self.sale.picking_ids
    picking.company_id.stock_move_email_validation = True
    delivery_template = self.env.ref("delivery_state.delivery_notification")
    picking.company_id.stock_mail_confirmation_template_id = delivery_template
    picking.carrier_tracking_ref = "XX-0000"
    picking.move_lines.quantity_done = 1
    picking._action_done()
    mail = self.env["mail.message"].search(
        [("partner_ids", "in", self.partner.ids)]
    )
    self.assertTrue("XX-0000" in mail.body)