something like
{{{
# settings.py
DATABASES = {
'secondary': {
'TEST': {
'CREATE': False
}
}
}
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28475>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: Adam (Chainz) Johnson (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/28475#comment:1>
* component: Uncategorized => Testing framework
* version: 1.11 => master
* type: Uncategorized => New feature
--
Ticket URL: <https://code.djangoproject.com/ticket/28475#comment:2>
* component: Testing framework => Uncategorized
* version: master => 1.11
* type: New feature => Uncategorized
Old description:
> I would like to specify in settings.py DATABASES variable that some
> database connection should be skipped for test database creation.
>
> something like
>
> {{{
> # settings.py
> DATABASES = {
> 'secondary': {
> 'TEST': {
> 'CREATE': False
> }
> }
> }
> }}}
New description:
I would like to specify in settings.py DATABASES variable that some
database connection should be skipped for test database creation.
something like
{{{
# settings.py
DATABASES = {
'secondary': {
'TEST': {
'CREATE': False
}
}
}
}}}
This is necessary because my project has multiple database connections,
some using a Readonly user on the database. When the test management
command runs it attempts to create a test database using readonly
credentials and the entire test suite fails. A user should be able to
specify if a test database should not be created on a database.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/28475#comment:3>
Old description:
> I would like to specify in settings.py DATABASES variable that some
> database connection should be skipped for test database creation.
>
> something like
>
> {{{
> # settings.py
> DATABASES = {
> 'secondary': {
> 'TEST': {
> 'CREATE': False
> }
> }
> }
> }}}
New description:
I would like to specify in settings.py DATABASES variable that some
database connection should be skipped for test database creation.
something like
{{{
# settings.py
DATABASES = {
'secondary': {
'TEST': {
'CREATE': False
}
}
}
}}}
This is necessary because my project has multiple database connections,
some using a Readonly user on the database. When the test management
command runs it attempts to create a test database using readonly
credentials and the entire test suite fails. A user should be able to
specify if a test database should not be created on a database.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/28475#comment:3>
Comment (by Tim Graham):
I think the easiest solution is to use a separate test settings file that
deletes the unneeded entries from `DATABASES`. Any downside to that?
--
Ticket URL: <https://code.djangoproject.com/ticket/28475#comment:4>
Comment (by Harry Moreno):
I think a test_settings.py file would work. I just could not find the
relevant docs before.
https://docs.djangoproject.com/en/1.11/topics/testing/advanced/#using-the-
django-test-runner-to-test-reusable-applications
closing.
--
Ticket URL: <https://code.djangoproject.com/ticket/28475#comment:5>
* status: new => closed
* resolution: => worksforme
--
Ticket URL: <https://code.djangoproject.com/ticket/28475#comment:6>