Code

Opened 4 years ago

Closed 4 years ago

#14001 closed (wontfix)

Can't use testing w/out having db creation privileges

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

Description

You can't run ./manage.py test unless you have CREATE DATABASE privileges. This kind of sucks if you're on a shared server and you can only create databases thru the admin panel, or you're only alloted a few. There's really no reason Django shouldn't allow you to choose one of these manually created databases; then instead of dropping the whole DB after running all the tests, you can just drop the tables.

I'm submitting a patch to show how it can be done, but this is a hack specifically for PostgreSQL.

Attachments (1)

creation.py (20.1 KB) - added by mnbayazit 4 years ago.
hack for postgresql to allow choosing test database/username/password

Download all attachments as: .zip

Change History (2)

Changed 4 years ago by mnbayazit

hack for postgresql to allow choosing test database/username/password

comment:1 Changed 4 years ago by jacob

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

This is an assumption we need to make to make testing predictable and stable. If it's an assumption that breaks for you, you should look into writing a custom test runner.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.