How to script the setup wizard?

For context, this is part of the work I’m doing to import mailman2 into discourse. The test would run from tox which would:

  • create a new discourse instance
  • run various tests
  • destroy the discourse instance