﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
20550	Add an option to preserve the database between test runs	Aymeric Augustin	Greg Chapple	"Creating database tables is expensive. #20483 says it takes 200s to create the tables required by Django's test suite with PostgreSQL. At $DAY_JOB, we have a few hundreds of models, and it takes about one minute to create a test database with PostgreSQL and a SSD.

To mitigate this problem, I've implemented a custom test runner that adds `--nocreatedb` and `--nodropdb` options to `django-admin.py test`. The names are self-explanatory. I'm not going to publish the implementation because it's totally unsuitable for Django. (It monkey-patches `BaseDatabaseCreation.create_test_db/destroy_test_db` when the flags are set.)

I'd like to implement a similar feature in Django. In the light of my first experience, I suggest a simpler API. I would add a single flag `--keepdb`. When this flag is set:
- at the beginning of the tests, if the database already exists, Django doesn't ask to delete it; it goes ahead and reuses it;
- at the end of the tests, Django doesn't drop the database."	New feature	closed	Testing framework	dev	Normal	fixed		gregchapple1@… mmanfre@…	Accepted	1	0	0	0	0	0
