#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:  1                    |  decision needed
  Needs tests:  0                    |      Needs documentation:  0
Easy pickings:  0                    |  Patch needs improvement:  0
                                     |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by akaariai):

 Attached is a tests.py file, which will demonstrate that the attached
 patch does work. However, there are no tests included in the test suite.
 You will need to create a new test project, and set up that project to use
 PostgreSQL. Then start an app, copy the tests to that app and run the
 tests. Using master, the leftover threads connect to the production DB,
 but using the attached patch the connection is made to the just dropped
 test database. The attached patch is basically the same as 10868.settings-
 dict-copy.2.diff, but it has the minor cleanup mentioned in the above
 comment.

 To include a full test of this in the test suite would require testing
 `DjangoTestRunner`.teardown_databases(). That is naturally a bit
 problematic.

 There are release notes in the patch, but they do require rewriting, and
 it is questionable if anything about this needs to be included.

 I think this is now ready for checkin, but maybe somebody else needs to
 tick that box as I have altered the patch slightly.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/10868#comment:22>
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.

Reply via email to