Opened 4 years ago

Closed 4 years ago

#31009 closed Bug (wontfix)

Test database named just "test_".

Reported by: rvernica Owned by: nobody
Component: Database layer (models, ORM) Version: dev
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

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

Change History (2)

comment:1 by Simon Charette, 4 years ago

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 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. Given a test_ database name is completely valid and this would thus yield cosmetic only benefits I'm inclined to close this as wontfix.

Last edited 4 years ago by Simon Charette (previous) (diff)

comment:2 by Mariusz Felisiak, 4 years ago

Resolution: wontfix
Status: newclosed
Summary: Test database named just "test_"Test database named just "test_".
Version: 2.1master

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

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