Suggestion on how to test by running an local server?

I have a Django REST app with some unit test that mocks out external dependency. Now I want to add some test that run a local development server and make some call against it to simulate some real interactions.

This might actually mean I end up testing external dependencies but that is fine. I just want to know if the Django app is working end to end even the fault is due to an external dependency (e.g. a database record missing).

Any suggestion on how to approach this?

Should I try to do this within a python test where in a setup somewhere I spin up a local development server and then have a suite of test that calls against it?

Should I have a shell script that runs a local server first and then call a suite of python test that calls against?

If you’re looking for repeatability in your test, I’d recommend using DRF’s APIClient to make the requests as necessary. You’ll still need to setup the existing data necessary to run the test. However, this would be able to be run as a part of your projects test suite, including as a part of your CI.