def METHOD_NAME(self):
    contract = self.env["contract.contract"].create(
        {
            "name": "Test contract",
            "partner_id": self.partner.id,
            "payment_mode_id": self.payment_mode.id,
        }
    )
    self.assertEqual(contract.payment_mode_id, self.payment_mode)
    contract.payment_mode_id = False
    self.assertEqual(contract.payment_mode_id.id, False)
    post_init_hook(self.cr, self.env)
    self.assertEqual(contract.payment_mode_id, self.payment_mode)