def METHOD_NAME(self):
    self.exception_rule.write(
        {
            "domain": "[('partner_id.zip', '=', False)]",
            "exception_type": "by_domain",
        }
    )
    with self.assertRaises(ValidationError):
        self.po.button_confirm()
    self.po.with_context(raise_exception=False).button_confirm()
    self.assertTrue(self.po.exception_ids)