#12991: Django 1.2 should have optional support for unittest2
----------------------------------------+-----------------------------------
          Reporter:  ericholscher       |         Owner:  PaulM
            Status:  assigned           |     Milestone:  1.3  
         Component:  Testing framework  |       Version:  SVN  
        Resolution:                     |      Keywords:       
             Stage:  Accepted           |     Has_patch:  1    
        Needs_docs:  1                  |   Needs_tests:  0    
Needs_better_patch:  0                  |  
----------------------------------------+-----------------------------------
Changes (by ericholscher):

  * needs_docs:  0 => 1
  * version:  => SVN
  * milestone:  => 1.3

Comment:

 Paul:

 We probably need to add documentation for these changes. I'm thinking in
 the Testing Django document, and maybe a note in the contributing section
 as well. Otherwise this looks good to me.


 A summary of the patch:


 The changes in tests/regressiontests/test_client_regress/models.py are to
 address changes in the string output of exceptions in unittest2. Otherwise
 this is just the importing of stock unittest2 with 2 changes:

  * The imports inside of unittest2 where absolute (from unittest2...) --
 we had to change these to import from the django source tree so they are
 valid. This is the same approach taken in the simplejson module already
 included in Django.

  * The __init__.py was moved to another file and the new init is doing
 some magic to check if the user already has 2.7 or another version of
 unittest2 installed, and uses that before the bundled one. This is because
 it is assumed that people might have more up to date versions of the
 package than we ship.


 The import for the new package is django.utils.unittest -- we made this
 unittest instead of unittest2 because unittest2 is actually just the
 unittest package from 2.7. So you can import django.utils.unittest in your
 package and know you are getting the 2.7 version of unittest.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12991#comment:8>
Django <http://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 django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to