mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
Fixed #12991 -- Added unittest2 support. Thanks to PaulM for the draft patch, and to Luke, Karen, Justin, Alex, Łukasz Rekucki, and Chuck Harmston for their help testing and reviewing the final patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14139 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -136,3 +136,31 @@ have been added to Django's own code as well -- most notably, the
|
||||
error emails sent on a HTTP 500 server error are now handled as a
|
||||
logging activity. See :doc:`the documentation on Django's logging
|
||||
interface </topics/logging>` for more details.
|
||||
|
||||
``unittest2`` support
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Python 2.7 introduced some major changes to the unittest library,
|
||||
adding some extremely useful features. To ensure that every Django
|
||||
project can benefit from these new features, Django ships with a
|
||||
copy of unittest2_, a copy of the Python 2.7 unittest library,
|
||||
backported for Python 2.4 compatibility.
|
||||
|
||||
To access this library, Django provides the
|
||||
``django.utils.unittest`` module alias. If you are using Python
|
||||
2.7, or you have installed unittest2 locally, Django will mapt the
|
||||
alias to the installed version of the unittest library Otherwise,
|
||||
Django will use it's own bundled version of unittest2.
|
||||
|
||||
To use this alias, simply use::
|
||||
|
||||
from django.utils import unittest
|
||||
|
||||
wherever you would historically used::
|
||||
|
||||
import unittest
|
||||
|
||||
If you want to continue to use the base unittest libary, you can --
|
||||
you just won't get any of the nice new unittest2 features.
|
||||
|
||||
.. _unittest2: http://pypi.python.org/pypi/unittest2
|
||||
|
||||
Reference in New Issue
Block a user