I wrote some test case to test my django project, when I run them in jenkins it always create a default database, I want to test my project with my own database, how to do?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Django always expects to have a default database as described in the documentation for the DATABASES setting.
The default tags is simply the name by which you refer to the database, not the name of the database itself. In the documentation example above, even though the database handle is default, the name of the database itself is mydatabase.
When you’re testing, it is usual to use a different database than your production database and for this you can use the TEST_NAME specification for the database. The following settings.py shows the names of the databases used during production and unit testing.
The following link gives some useful information on testing. https://docs.djangoproject.com/en/dev/topics/testing/