I think my problem is very common but I couldn't phrase it correctly in the title.
I have a Django API that returns some information about companies (like address, partners, situation, etc) given its unique identifier. I would like to run tests on it because it is very unstable given that it depends on a lot of data that I sometimes I can't predict (like null addresses, invalid situations, no partners, etc) and are hard to predict while I'm coding.
I don't know how to run efficient tests on it given that it is not feasible to run it for every company (there are millions of it). I think maybe an idea is to do it by sampling, but this would lead to unpredictable tests since it might work for some companies and others not, running tests for only a subset of predefined ones wouldn't be ideal because it might lead to biased tests (they pass on those but there are some companies that it doesn't).
Does anyone have an idea for a solution?