Opened 9 years ago

Closed 9 years ago

#25899 closed New feature (worksforme)

manage.py tests requires database creation privileges

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

Description

From

#https://docs.djangoproject.com/en/1.9/topics/testing/overview/#the-test-database
By default the test databases get their names by prepending test_ to the value of the NAME settings for the databases defined in DATABASES. 

I guess this works great on sqlite and my homegrown postgres machine, but I'm developing applications on Oracle RAC clusters, and I hope you can see this is not an environment I'd be allowed to create databases on. The database schemas are rather complex (using things like RAW(16) primary keys and reference-based partitioning) and I'm not allowing Django to make the tables itself.

I have been unable to find a workaround in documentation (e.g. --use-this-database-instead-of-creating-one= and --assume-models-are-present ). If this exists, please change this ticket into a documentation request instead.

Change History (8)

comment:1 by JorisBenschop, 9 years ago

Component: UncategorizedTesting framework

comment:2 by Tim Graham, 9 years ago

A couple sentences after the one you quoted, "If you want to use a different database name, specify NAME in the TEST dictionary for any given database in DATABASES." Could you combine this with the manage.py test --keepdb option to get the desired result?

comment:3 by Shai Berger, 9 years ago

There are TEST parameters for this -- Everything from CREATE_DB onwards is essentially serving the need you raise here. Note that settings are much more appropriate than command arguments for this use-case.

Can you offer a documentation change that will make these settings easier to find?

(NAME, specifically, has a very different meaning on Oracle -- it selects the service to connect to, rather than a database on that service like it does for other backends.)

comment:4 by Tim Graham, 9 years ago

Doc proposal for the testings docs.

Maybe a subsection under Oracle in docs/ref/databases.txt could also be added if we need more details about those Oracle specific settings?

comment:5 by JorisBenschop, 9 years ago

Apologies, I should have read more thoroughly. I will use the pointers given. Thanks for the docs improvement also. I guess this ticket can be resolved-fixed-closed?

comment:6 by Tim Graham <timograham@…>, 9 years ago

In 738bda8:

Refs #25899 -- Improved visibility of TEST database settings in testing docs.

comment:7 by Tim Graham <timograham@…>, 9 years ago

In 9f3ce6d9:

[1.9.x] Refs #25899 -- Improved visibility of TEST database settings in testing docs.

Backport of 738bda8a6feea95d07b73246365e75b3d25e3466 from master

comment:8 by Tim Graham, 9 years ago

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top