Is it possible to set a database as default without database creation permission for Django test db creation?

Hi Everyone,

I was wondering if it is a must that the default database needs to have database creation permission in order to use ‘python manage.py test’ function? what if a database without DB creation permission but set as default database in django? Can we still use ‘python manage.py test’ function?

Kelvin

In testing, doesn’t Django create a test db and remove it after testing??

If keepdb is True, the test suite will use the existing database, or create one if necessary. If False, a new database will be created, prompting the user to remove the existing one, if present.

Hi @white-seolpyo ,

That’s exactly what my concern is. When using Django test, Django will create a test db using production db schema. However, I don’t have permission to create databases in SQL Server, that means when using Django test, I’m unable to create test db at the beginning, and setting keepdb = True meaning only keep the test db that has already been created by prior testing processes to save up time for test db recreation.

So I was wondering if there are ways that Django test can be used even though no permissions for database creation?

Kelvin

If don’t give permission, won’t Django be able to create a test db?