I almost made myself finish reading my copy of your testing book before posting, in case you replied.
I think my main confusion about how to approach this comes down to figuring out where this testing should fit between unit testing and integration testing. For example I have a method that adds a heroku-specific setting to settings.py, that sets DEBUG
false by default in the deployed version of the project.
It’s probably straightforward to create a tmp settings.py file, and run this method against that file, and verify that the correct setting appears in the settings.py file. But what I really want to do is verify that running simple_deploy against a project parses the project correctly, finds the project’s settings.py file, and adds the appropriate setting to that file.
Should I use pytest to create a copy of the sample blog project in a pytest tmp directory, run the management command against the sample project, and then run a bunch of tests against the new state of the sample project? It’s a straightforward task to do that in bash, which is why I started my testing that way. Would it be reasonable to call a bash script from pytest to do that initial setup, and then do all the inspection in pytest?