|
@@ -107,20 +107,20 @@ See the :doc:`reference documentation of the app </ref/contrib/staticfiles>`
|
|
|
for more details or learn how to :doc:`manage static files
|
|
|
</howto/static-files/index>`.
|
|
|
|
|
|
-unittest2 support
|
|
|
------------------
|
|
|
+``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
|
|
|
+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 map the alias to the installed
|
|
|
-version of the unittest library. Otherwise, Django will use its own
|
|
|
-bundled version of unittest2.
|
|
|
+version of the ``unittest`` library. Otherwise, Django will use its own
|
|
|
+bundled version of ``unittest2``.
|
|
|
|
|
|
To take advantage of this alias, simply use::
|
|
|
|
|
@@ -130,8 +130,8 @@ wherever you would have historically used::
|
|
|
|
|
|
import unittest
|
|
|
|
|
|
-If you want to continue to use the base unittest library, you can --
|
|
|
-you just won't get any of the nice new unittest2 features.
|
|
|
+If you want to continue to use the base ``unittest`` library, you can --
|
|
|
+you just won't get any of the nice new ``unittest2`` features.
|
|
|
|
|
|
.. _unittest2: https://pypi.org/project/unittest2/
|
|
|
|
|
@@ -313,7 +313,7 @@ requests. These include:
|
|
|
:class:`~django.template.RequestContext` by default.
|
|
|
|
|
|
* Support for combining :class:`F expressions <django.db.models.F>`
|
|
|
- with timedelta values when retrieving or updating database values.
|
|
|
+ with ``timedelta`` values when retrieving or updating database values.
|
|
|
|
|
|
.. _HTTPOnly: https://www.owasp.org/index.php/HTTPOnly
|
|
|
|
|
@@ -712,7 +712,7 @@ list, even if it has only a single element or no elements.
|
|
|
``DjangoTestRunner``
|
|
|
--------------------
|
|
|
|
|
|
-As a result of the introduction of support for unittest2, the features
|
|
|
+As a result of the introduction of support for ``unittest2``, the features
|
|
|
of ``django.test.simple.DjangoTestRunner`` (including fail-fast
|
|
|
and Ctrl-C test termination) have been made redundant. In view of this
|
|
|
redundancy, ``DjangoTestRunner`` has been turned into an empty placeholder
|