Fractured and vuggy carbonate reservoirs present a complex storage space with irregularly distributed fractures and caves. Furthermore, these reservoirs typically feature the presence of a substantial bottom aquifer, further complicating the fluid flow dynamics. At present, most well test models for this reservoir are based on discrete media primarily address single-phase flow scenarios, typically considering caves as equipotential bodies. This approach cannot accurately represent the complexities of such reservoirs. In this paper, a three-dimensional numerical well test model for two-phase oil-water flow within fractured and vuggy carbonate reservoirs is introduced. Randomly generated natural fractures are embedded within the reservoir, and the Hagen-Poiseuille law is utilized to describe fluid flow within cave spaces, effectively coupling flow interactions across fractures, caves and the porous rock matrix. The computational domain is discretized by a perpendicular bisection grid, and the finite volume method is used to solve the model, allowing for the calculation of the pressure and saturation fields at each time step. Subsequently, well test type curves are constructed and analyzed, flow regimes are segmented, and sensitivity analysis of model parameters is conducted. The pressure buildup data from well A are interpreted, and the results demonstrate a remarkable agreement between the well test curve and actual data, confirming the capability of the model to capture reservoir characteristics and complex fluid flow phenomena. The findings lay the foundation for the development of numerical well test models tailored to fractured and vuggy carbonate reservoirs.