def METHOD_NAME(self):
    route = self.env.ref("purchase_stock.route_warehouse0_buy")
    rule = self.env["stock.rule"].search([("route_id", "=", route.id)], limit=1)
    rule._run_buy(
        procurements=[
            (
                self.env["procurement.group"].Procurement(
                    self.mto_product,
                    1,
                    self.mto_product.uom_id,
                    self.env["stock.location"].search([], limit=1),
                    "Procurement order test",
                    "Test",
                    rule.company_id,
                    {
                        "company_id": rule.company_id,
                        "date_planned": fields.Datetime.now(),
                    },
                ),
                rule,
            )
        ]
    )
    purchase = self.env["purchase.order"].search([("origin", "=", "Test")])
    self.assertEqual(purchase.payment_mode_id, self.payment_mode)