#23421: dict get for TEST_SERIALIZE in django.test.runner.setup_databases()
always
return True
-----------------------------------+--------------------
Reporter: gkoller | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------------+--------------------
Given the following in `settings.py`:
{{{
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
# ....
'TEST_SERIALIZE': False,
}
}
}}}
The call `serialize=connection.settings_dict.get("TEST_SERIALIZE", True)`
on line 299 in `django.test.runner.setup_databases` will always be set to
True as `TEST_SERIALIZE` is somewhere transformed into:
{{{
settings_dict = {
'TEST': {
'SERIALIZE`: True,
# ...
},
# ...
}
}}}
Hence the key lookup always fails, and `get()` will use the supplied
default value of `True`. A possible fix will be to rewrite that call to
something like:
{{{
serialize=connection.settings_dict["TEST"].get("SERIALIZE", True)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23421>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/050.77c230a890c85e14b098f79c74943ef8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.