Opened 8 years ago

Closed 2 years ago

#7857 closed New feature (wontfix)

manage.py shell, dbshell funtionality

Reported by: Sanha Owned by: Mark Barrett
Component: Core (Management commands) Version: master
Severity: Normal Keywords: manage.py, testserver, shell, dbshell
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

manage.py testserver is good funtion to test and develop application.

it recreate database 'test_' + database name.

when using testserver manage.py shell or manage.py dbshell connect original database.

I think that some option is useful to connect 'test_' + database at this time.

But, I can't find option like that.

Attachments (2)

testshell.patch (1005 bytes) - added by Mark Barrett 5 years ago.
New command which creates test database instead of real database when running interactive shell
testshell.diff (1005 bytes) - added by Mark Barrett 5 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 Changed 8 years ago by Sanha

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

for example these is useful to test.

manage.py testshell
manage.py testdbshell
}}

comment:2 Changed 8 years ago by Michael Radziej

milestone: post-1.0
Triage Stage: UnreviewedDesign decision needed

comment:3 Changed 8 years ago by Adrian Holovaty

Component: Toolsdjango-admin.py

comment:4 Changed 8 years ago by (none)

milestone: post-1.0

Milestone post-1.0 deleted

comment:5 Changed 7 years ago by bmihelac

For now you can use testshell command that I just assembled:

http://www.djangosnippets.org/snippets/1500/

comment:6 Changed 6 years ago by Jannis Leidel

Triage Stage: Design decision neededAccepted

Seems like a reasonable idea.

comment:7 Changed 6 years ago by Adam Vandenberg

Separate commands, or "--test" parameter to existing commands? Perhaps the separate "test*" commands are less error-prone.

comment:8 Changed 5 years ago by Luke Plant

Severity: Normal
Type: New feature

comment:9 Changed 5 years ago by Mark Barrett

Easy pickings: unset
Owner: changed from nobody to Mark Barrett
Status: newassigned
UI/UX: unset

Changed 5 years ago by Mark Barrett

Attachment: testshell.patch added

New command which creates test database instead of real database when running interactive shell

Changed 5 years ago by Mark Barrett

Attachment: testshell.diff added

comment:10 Changed 5 years ago by Mark Barrett

Has patch: set

comment:11 Changed 5 years ago by Aymeric Augustin

I can't see under which circumstances this command would be useful.

comment:12 Changed 4 years ago by sjl@…

It is useful to explore fixtures in the interactive shell, otherwise you are reduced to printf-style debugging in the test case.

comment:13 Changed 4 years ago by Aymeric Augustin

You can use pdb in tests.

comment:14 Changed 2 years ago by Tim Graham

Resolution: wontfix
Status: assignedclosed

I agree with Aymeric (aaugustin), that this doesn't seem very necessary. Please use the snippet if you need it.

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