[Django] #31009: Test database named just "test_"

29 views
Skip to first unread message

Django

unread,
Nov 20, 2019, 5:17:26 PM11/20/19
to django-...@googlegroups.com
#31009: Test database named just "test_"
-------------------------------------+-------------------------------------
Reporter: rvernica | Owner: nobody
Type: Bug | Status: new
Component: Database | Version: 2.1
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
When I do `manage.py test` the database that is created is named only
`test_`

In `settings.py` I have:
{{{
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'OPTIONS': {
'read_default_file': 'app/my.cnf',
},
}
}
}}}

while in `my.cfg` I have:
{{{
[client]
host = db
database = foo
user = bar
password = taz
default-character-set = utf8
}}}

I expect that the test database be called `test_foo`

--
Ticket URL: <https://code.djangoproject.com/ticket/31009>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 20, 2019, 7:41:13 PM11/20/19
to django-...@googlegroups.com
#31009: Test database named just "test_"
-------------------------------------+-------------------------------------
Reporter: rvernica | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 2.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Simon Charette):

Not sure what to do here. It looks like #30636 added tested support for
using `read_default_file` with `manage.py` test but it assumed `NAME` was
provided.

Given [https://docs.djangoproject.com/en/2.2/ref/settings/#test we already
provide an option] to specify the test database name I'm not convinced
teaching the test database name generation logic to parse CNF files if
`NAME` is not provided is worth the complexity it incurs. I'm inclined to
close this as ''wontfix''.

--
Ticket URL: <https://code.djangoproject.com/ticket/31009#comment:1>

Django

unread,
Nov 21, 2019, 2:06:26 AM11/21/19
to django-...@googlegroups.com
#31009: Test database named just "test_".

-------------------------------------+-------------------------------------
Reporter: rvernica | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* status: new => closed
* version: 2.1 => master
* resolution: => wontfix


Comment:

I agree with Simon, we don't want to parse `cnf` files and we provide an
option to specify the test database name.

--
Ticket URL: <https://code.djangoproject.com/ticket/31009#comment:2>

Reply all
Reply to author
Forward
0 new messages