Opened 5 years ago

Closed 5 years ago

#12122 closed (wontfix)

don't create test database on ./manage.py test

Reported by: Exe Owned by: nobody
Component: Testing framework Version: 1.1
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Hello!

./manage.py tries to create database even if it's exists!

I don't want such behavior as I don't want to grant database creation to my users.
So I can propose solution:

do not create database if it's exist. Instead drop all tables in it.

Change History (1)

comment:1 Changed 5 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

What you propose sounds like extremely dangerous behavior to exist as a default. If a database already exists, then there's a reasonable chance that it could contain useful data. If the default behavior of the test suite is to purge the contents of a database, it would be very easy to accidentally lose that data through the simple act of running a test suite.

If you don't like Django's default test setup/teardown procedure, it is configurable - see the documentation on writing a custom test runner.

Note: See TracTickets for help on using tickets.
Back to Top