I'm looking for some best-practice advice on how to go about writing tests in this specific scenario I have.
I've got a Django API that runs against a postgres database (which I have control over on my server) as well as a remote read-only MySQL database. The read-only db is provided by an external service, and they do provide a pretty liberal API for writing data to their database (so we overwrite our .save
method to write to the API, rather than using the database directly), but this is all production data, so not something I want to mess with for tests.
Do people have thoughts on how to organize this project so that it sets up a similar MySQL database, or just continuously mocks every write (in a way that writing API endpoint integration tests are still do-able).
Happy to provide more details if needed.
Aucun commentaire:
Enregistrer un commentaire