#10868: _destroy_test_db exposes the production database to possibly destructive
actions from the unit tests
-------------------------------------+-------------------------------------
Reporter: ovidiu | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version:
Severity: Release blocker | Resolution:
Keywords: django.test | Triage Stage: Design
Has patch: 0 | decision needed
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by adrian):
akaariai: Thanks for the detailed explanation. Even if we fixed line 323
in backends/creation.py ({{{self.connection.settings_dict['NAME'] =
old_database_name}}}), I think we'd still have a problem due to these
lines (319-324) in {{{django/test/simple.py}}} --
{{{#!python
# Destroy all the non-mirror databases
for connection, old_name, destroy in old_names:
if destroy:
connection.creation.destroy_test_db(old_name,
self.verbosity)
else:
connection.settings_dict['NAME'] = old_name
}}}
I like your potential fix of making a copy of the settings dict to ensure
it only affects the current thread -- so would we have to do the same
thing in the {{{django/test/simple.py}}} lines above? Mind writing up a
patch of this approach?
--
Ticket URL: <https://code.djangoproject.com/ticket/10868#comment:5>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.