{{{
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.
* severity: Normal => Release blocker
* needs_better_patch: => 0
* needs_tests: => 0
* easy: 1 => 0
* needs_docs: => 0
* stage: Unreviewed => Accepted
Comment:
Added in [8c12d51e]. Not sure what the intention was, but documenting that
it should be set in the test dictionary seems okay. It needs documentation
as well.
--
Ticket URL: <https://code.djangoproject.com/ticket/23421#comment:1>
Comment (by timgraham):
Andrew says, "I think it was meant to be a way to turn off the full
serialization of data using loaddata during test runs; however it's
useless due to TransactionTestCases, so perhaps should be excised."
Was there a use case where you needed to set it to False?
--
Ticket URL: <https://code.djangoproject.com/ticket/23421#comment:2>
* status: new => assigned
* owner: nobody => timgraham
--
Ticket URL: <https://code.djangoproject.com/ticket/23421#comment:3>
* has_patch: 0 => 1
Comment:
I found how the option could be useful:
[https://github.com/django/django/pull/3222 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/23421#comment:4>
* stage: Accepted => Ready for checkin
Comment:
Pull request looks good to me.
--
Ticket URL: <https://code.djangoproject.com/ticket/23421#comment:5>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"a4f23eba2e690f1331fe35d6f29af42899e80395"]:
{{{
#!CommitTicketReference repository=""
revision="a4f23eba2e690f1331fe35d6f29af42899e80395"
Fixed #23421 -- Corrected TEST SERIALIZE setting.
Thanks gkoller for the report.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23421#comment:6>
Comment (by Tim Graham <timograham@…>):
In [changeset:"02aa3e30e9cb8e5be5c33082c3548e2a6e1b91cb"]:
{{{
#!CommitTicketReference repository=""
revision="02aa3e30e9cb8e5be5c33082c3548e2a6e1b91cb"
[1.7.x] Fixed #23421 -- Corrected TEST SERIALIZE setting.
Thanks gkoller for the report and Markus Holtermann for review.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23421#comment:7>