Using --reuse-db will create the test database in the same way as manage.py test usually does. However, after the test run, the test database will not be removed. The next time a test run is started with --reuse-db, the database will instantly be re used. This will allow much faster startup time for tests.
Would like to know as well. The --reuse-db flag is useful to create the skeleton DB schema, but there are times where I want to actually inspect the data generated from all of the tests.
As per the docs:
This actually doesn't work
Here's
pytest.ini
and here's
django_db_setup
and
django_db_keepdb
evaluates toTrue
. Here's the tests:which results in:
and the expected results are
So, how to actually obtain this outcome?