mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #14000 - remove versionadded/changed tags for Django 1.0 and 1.1
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15055 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -191,8 +191,6 @@ Methods
|
||||
|
||||
.. method:: models.User.set_unusable_password()
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
Marks the user as having no password set. This isn't the same as
|
||||
having a blank string for a password.
|
||||
:meth:`~django.contrib.auth.models.User.check_password()` for this user
|
||||
@@ -204,8 +202,6 @@ Methods
|
||||
|
||||
.. method:: models.User.has_usable_password()
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
Returns ``False`` if
|
||||
:meth:`~django.contrib.auth.models.User.set_unusable_password()` has
|
||||
been called for this user.
|
||||
@@ -396,9 +392,6 @@ to salt the raw password to create the hash. Note that the ``crypt`` method is
|
||||
only supported on platforms that have the standard Python ``crypt`` module
|
||||
available.
|
||||
|
||||
.. versionadded:: 1.0
|
||||
Support for the ``crypt`` module is new in Django 1.0.
|
||||
|
||||
For example::
|
||||
|
||||
sha1$a1976$a36cc8cbf81742a8fb52e221aaeab48ed7f58ab4
|
||||
@@ -451,9 +444,6 @@ they're used by Web requests, as explained in the next section.
|
||||
Creating superusers
|
||||
-------------------
|
||||
|
||||
.. versionadded:: 1.0
|
||||
The ``manage.py createsuperuser`` command is new.
|
||||
|
||||
:djadmin:`manage.py syncdb <syncdb>` prompts you to create a superuser the
|
||||
first time you run it after adding ``'django.contrib.auth'`` to your
|
||||
:setting:`INSTALLED_APPS`. If you need to create a superuser at a later date,
|
||||
@@ -654,9 +644,6 @@ How to log a user out
|
||||
Note that :func:`~django.contrib.auth.logout()` doesn't throw any errors if
|
||||
the user wasn't logged in.
|
||||
|
||||
.. versionchanged:: 1.0
|
||||
Calling ``logout()`` now cleans session data.
|
||||
|
||||
When you call :func:`~django.contrib.auth.logout()`, the session data for
|
||||
the current request is completely cleaned out. All existing data is
|
||||
removed. This is to prevent another person from using the same Web browser
|
||||
|
||||
@@ -317,8 +317,6 @@ activate dummy caching, set :setting:`BACKEND <CACHES-BACKEND>` like so::
|
||||
Using a custom cache backend
|
||||
----------------------------
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
While Django includes support for a number of cache backends out-of-the-box,
|
||||
sometimes you might want to use a customized cache backend. To use an external
|
||||
cache backend with Django, use the Python import path as the
|
||||
@@ -416,10 +414,6 @@ arguments.
|
||||
The per-site cache
|
||||
==================
|
||||
|
||||
.. versionchanged:: 1.0
|
||||
(previous versions of Django only provided a single ``CacheMiddleware`` instead
|
||||
of the two pieces described below).
|
||||
|
||||
Once the cache is set up, the simplest way to use caching is to cache your
|
||||
entire site. You'll need to add
|
||||
``'django.middleware.cache.UpdateCacheMiddleware'`` and
|
||||
@@ -473,8 +467,6 @@ Additionally, the cache middleware automatically sets a few headers in each
|
||||
|
||||
See :doc:`/topics/http/middleware` for more on middleware.
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
If a view sets its own cache expiry time (i.e. it has a ``max-age`` section in
|
||||
its ``Cache-Control`` header) then the page will be cached until the expiry
|
||||
time, rather than :setting:`CACHE_MIDDLEWARE_SECONDS`. Using the decorators in
|
||||
@@ -586,8 +578,6 @@ URLconf.
|
||||
Template fragment caching
|
||||
=========================
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
If you're after even more control, you can also cache template fragments using
|
||||
the ``cache`` template tag. To give your template access to this tag, put
|
||||
``{% load cache %}`` near the top of your template.
|
||||
@@ -705,8 +695,6 @@ return if the object doesn't exist in the cache::
|
||||
>>> cache.get('my_key', 'has expired')
|
||||
'has expired'
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
To add a key only if it doesn't already exist, use the ``add()`` method.
|
||||
It takes the same parameters as ``set()``, but it will not attempt to
|
||||
update the cache if the key specified is already present::
|
||||
@@ -761,8 +749,6 @@ from the cache, not just the keys set by your application. ::
|
||||
|
||||
>>> cache.clear()
|
||||
|
||||
.. versionadded:: 1.1
|
||||
|
||||
You can also increment or decrement a key that already exists using the
|
||||
``incr()`` or ``decr()`` methods, respectively. By default, the existing cache
|
||||
value will incremented or decremented by 1. Other increment/decrement values
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
Conditional View Processing
|
||||
===========================
|
||||
|
||||
.. versionadded:: 1.1
|
||||
|
||||
HTTP clients can send a number of headers to tell the server about copies of a
|
||||
resource that they have already seen. This is commonly used when retrieving a
|
||||
Web page (using an HTTP ``GET`` request) to avoid sending all the data for
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
Aggregation
|
||||
===========
|
||||
|
||||
.. versionadded:: 1.1
|
||||
|
||||
.. currentmodule:: django.db.models
|
||||
|
||||
The topic guide on :doc:`Django's database-abstraction API </topics/db/queries>`
|
||||
|
||||
@@ -387,8 +387,6 @@ work; all are optional.
|
||||
Extra fields on many-to-many relationships
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
When you're only dealing with simple many-to-many relationships such as
|
||||
mixing and matching pizzas and toppings, a standard :class:`~django.db.models.ManyToManyField` is all you need. However, sometimes
|
||||
you may need to associate data with the relationship between two models.
|
||||
@@ -553,8 +551,6 @@ can be made; see :ref:`the model field reference <ref-onetoone>` for details.
|
||||
|
||||
.. _One-to-one relationship model example: http://www.djangoproject.com/documentation/models/one_to_one/
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
:class:`~django.db.models.OneToOneField` fields also accept one optional argument
|
||||
described in the :ref:`model field reference <ref-onetoone>`.
|
||||
|
||||
@@ -606,8 +602,6 @@ particular database engine.
|
||||
Custom field types
|
||||
------------------
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
If one of the existing model fields cannot be used to fit your purposes, or if
|
||||
you wish to take advantage of some less common database column types, you can
|
||||
create your own field class. Full coverage of creating your own fields is
|
||||
@@ -769,8 +763,6 @@ on :doc:`using raw SQL</topics/db/sql>`.
|
||||
Model inheritance
|
||||
=================
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
Model inheritance in Django works almost identically to the way normal
|
||||
class inheritance works in Python. The only decision you have to make
|
||||
is whether you want the parent models to be models in their own right
|
||||
@@ -1026,8 +1018,6 @@ to indicate that your field is the link back to the parent class.
|
||||
Proxy models
|
||||
------------
|
||||
|
||||
.. versionadded:: 1.1
|
||||
|
||||
When using :ref:`multi-table inheritance <multi-table-inheritance>`, a new
|
||||
database table is created for each subclass of a model. This is usually the
|
||||
desired behavior, since the subclass needs a place to store any additional
|
||||
|
||||
@@ -475,8 +475,6 @@ those latter objects, you could write::
|
||||
Spanning multi-valued relationships
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
When you are filtering an object based on a ``ManyToManyField`` or a reverse
|
||||
``ForeignKey``, there are two different sorts of filter you may be
|
||||
interested in. Consider the ``Blog``/``Entry`` relationship (``Blog`` to
|
||||
@@ -532,8 +530,6 @@ filtering on different linked objects.
|
||||
Filters can reference fields on the model
|
||||
-----------------------------------------
|
||||
|
||||
.. versionadded:: 1.1
|
||||
|
||||
In the examples given so far, we have constructed filters that compare
|
||||
the value of a model field with a constant. But what if you want to compare
|
||||
the value of a model field with another field on the same model?
|
||||
@@ -818,8 +814,6 @@ complete query set::
|
||||
Updating multiple objects at once
|
||||
=================================
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
Sometimes you want to set a field to a particular value for all the objects in
|
||||
a ``QuerySet``. You can do this with the ``update()`` method. For example::
|
||||
|
||||
@@ -858,8 +852,6 @@ Just loop over them and call ``save()``::
|
||||
for item in my_queryset:
|
||||
item.save()
|
||||
|
||||
.. versionadded:: 1.1
|
||||
|
||||
Calls to update can also use :ref:`F() objects <query-expressions>` to update
|
||||
one field based on the value of another field in the model. This is especially
|
||||
useful for incrementing counters based upon their current value. For example, to
|
||||
|
||||
@@ -338,8 +338,6 @@ In this example, ``a.save()`` will not be undone in the case where
|
||||
Database-level autocommit
|
||||
-------------------------
|
||||
|
||||
.. versionadded:: 1.1
|
||||
|
||||
With PostgreSQL 8.2 or later, there is an advanced option to run PostgreSQL
|
||||
with :doc:`database-level autocommit </ref/databases>`. If you use this option,
|
||||
there is no constantly open transaction, so it is always possible to continue
|
||||
|
||||
@@ -201,8 +201,6 @@ from the request's POST data, sends that to admin@example.com and redirects to
|
||||
The EmailMessage class
|
||||
======================
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
Django's :meth:`~django.core.mail.send_mail()` and
|
||||
:meth:`~django.core.mail.send_mass_mail()` functions are actually thin
|
||||
wrappers that make use of the :class:`~django.core.mail.EmailMessage` class.
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
Managing files
|
||||
==============
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
This document describes Django's file access APIs.
|
||||
|
||||
By default, Django stores files locally, using the :setting:`MEDIA_ROOT` and
|
||||
|
||||
@@ -176,8 +176,6 @@ itself. When rendering a formset in a template, you can include all
|
||||
the management data by rendering ``{{ my_formset.management_form }}``
|
||||
(substituting the name of your formset as appropriate).
|
||||
|
||||
.. versionadded:: 1.1
|
||||
|
||||
``total_form_count`` and ``initial_form_count``
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
@@ -114,9 +114,6 @@ There are three code paths here:
|
||||
3. If the form has been submitted but is invalid, the bound form instance is
|
||||
passed on to the template.
|
||||
|
||||
.. versionchanged:: 1.0
|
||||
The ``cleaned_data`` attribute was called ``clean_data`` in earlier releases.
|
||||
|
||||
The distinction between **bound** and **unbound** forms is important. An unbound
|
||||
form does not have any data associated with it; when rendered to the user, it
|
||||
will be empty or will contain default values. A bound form does have submitted
|
||||
@@ -345,10 +342,6 @@ error in a hidden field is a sign of form tampering, since normal form
|
||||
interaction won't alter them. However, you could easily insert some error
|
||||
displays for those form errors, as well.
|
||||
|
||||
.. versionadded:: 1.1
|
||||
The ``hidden_fields`` and ``visible_fields`` methods are new in Django
|
||||
1.1.
|
||||
|
||||
Reusable form templates
|
||||
-----------------------
|
||||
|
||||
|
||||
@@ -111,11 +111,6 @@ the full list of conversions:
|
||||
``widget=forms.Textarea``
|
||||
=============================== ========================================
|
||||
|
||||
|
||||
.. versionadded:: 1.0
|
||||
The ``FloatField`` form field and ``DecimalField`` model and form fields
|
||||
are new in Django 1.0.
|
||||
|
||||
.. versionadded:: 1.2
|
||||
The ``BigIntegerField`` is new in Django 1.2.
|
||||
|
||||
@@ -311,12 +306,8 @@ model fields:
|
||||
|
||||
2. Use the ``fields`` attribute of the ``ModelForm``'s inner ``Meta``
|
||||
class. This attribute, if given, should be a list of field names
|
||||
to include in the form.
|
||||
|
||||
.. versionchanged:: 1.1
|
||||
|
||||
The form will render the fields in the same order they are specified in the
|
||||
``fields`` attribute.
|
||||
to include in the form. The order in which the fields names are specified
|
||||
in that list is respected when the form renders them.
|
||||
|
||||
3. Use the ``exclude`` attribute of the ``ModelForm``'s inner ``Meta``
|
||||
class. This attribute, if given, should be a list of field names
|
||||
@@ -456,8 +447,6 @@ parameter when declaring the form field::
|
||||
Changing the order of fields
|
||||
----------------------------
|
||||
|
||||
.. versionadded:: 1.1
|
||||
|
||||
By default, a ``ModelForm`` will render fields in the same order that they are
|
||||
defined on the model, with ``ManyToManyField`` instances appearing last. If
|
||||
you want to change the order in which fields are rendered, you can use the
|
||||
|
||||
@@ -4,8 +4,6 @@ File Uploads
|
||||
|
||||
.. currentmodule:: django.core.files
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
When Django handles a file upload, the file data ends up placed in
|
||||
:attr:`request.FILES <django.http.HttpRequest.FILES>` (for more on the
|
||||
``request`` object see the documentation for :doc:`request and response objects
|
||||
|
||||
@@ -29,8 +29,6 @@ from your ``INSTALLED_APPS``. It'll save you a small bit of overhead.
|
||||
Configuring the session engine
|
||||
==============================
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
By default, Django stores sessions in your database (using the model
|
||||
``django.contrib.sessions.models.Session``). Though this is convenient, in
|
||||
some setups it's faster to store session data elsewhere, so Django can be
|
||||
@@ -50,9 +48,6 @@ Using cached sessions
|
||||
|
||||
For better performance, you may want to use a cache-based session backend.
|
||||
|
||||
.. versionchanged:: 1.1
|
||||
Django 1.0 did not include the ``cached_db`` session backend.
|
||||
|
||||
To store session data using Django's cache system, you'll first need to make
|
||||
sure you've configured your cache; see the :doc:`cache documentation
|
||||
</topics/cache>` for details.
|
||||
@@ -138,15 +133,10 @@ A session object has the following standard dictionary methods:
|
||||
|
||||
* ``clear()``
|
||||
|
||||
.. versionadded:: 1.0
|
||||
``setdefault()`` and ``clear()`` are new in this version.
|
||||
|
||||
It also has these methods:
|
||||
|
||||
* ``flush()``
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
Delete the current session data from the session and regenerate the
|
||||
session key value that is sent back to the user in the cookie. This is
|
||||
used if you want to ensure that the previous session data can't be
|
||||
@@ -173,8 +163,6 @@ It also has these methods:
|
||||
|
||||
* ``set_expiry(value)``
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
Sets the expiration time for the session. You can pass a number of
|
||||
different values:
|
||||
|
||||
@@ -198,24 +186,18 @@ It also has these methods:
|
||||
|
||||
* ``get_expiry_age()``
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
Returns the number of seconds until this session expires. For sessions
|
||||
with no custom expiration (or those set to expire at browser close), this
|
||||
will equal ``settings.SESSION_COOKIE_AGE``.
|
||||
|
||||
* ``get_expiry_date()``
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
Returns the date this session will expire. For sessions with no custom
|
||||
expiration (or those set to expire at browser close), this will equal the
|
||||
date ``settings.SESSION_COOKIE_AGE`` seconds from now.
|
||||
|
||||
* ``get_expire_at_browser_close()``
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
Returns either ``True`` or ``False``, depending on whether the user's
|
||||
session cookie will expire when the user's Web browser is closed.
|
||||
|
||||
@@ -302,8 +284,6 @@ Here's a typical usage example::
|
||||
Using sessions out of views
|
||||
===========================
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
An API is available to manipulate session data outside of a view::
|
||||
|
||||
>>> from django.contrib.sessions.backends.db import SessionStore
|
||||
@@ -393,8 +373,6 @@ browser-length cookies -- cookies that expire as soon as the user closes his or
|
||||
her browser. Use this if you want people to have to log in every time they open
|
||||
a browser.
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
This setting is a global default and can be overwritten at a per-session level
|
||||
by explicitly calling ``request.session.set_expiry()`` as described above in
|
||||
`using sessions in views`_.
|
||||
@@ -424,11 +402,6 @@ A few :doc:`Django settings </ref/settings>` give you control over session behav
|
||||
SESSION_ENGINE
|
||||
--------------
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
.. versionchanged:: 1.1
|
||||
The ``cached_db`` backend was added
|
||||
|
||||
Default: ``django.contrib.sessions.backends.db``
|
||||
|
||||
Controls where Django stores session data. Valid values are:
|
||||
@@ -443,8 +416,6 @@ See `configuring the session engine`_ for more details.
|
||||
SESSION_FILE_PATH
|
||||
-----------------
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
Default: ``/tmp/``
|
||||
|
||||
If you're using file-based session storage, this sets the directory in
|
||||
@@ -493,8 +464,6 @@ The name of the cookie to use for sessions. This can be whatever you want.
|
||||
SESSION_COOKIE_PATH
|
||||
-------------------
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
Default: ``'/'``
|
||||
|
||||
The path set on the session cookie. This should either match the URL path of
|
||||
|
||||
@@ -152,8 +152,6 @@ This example is equivalent to::
|
||||
|
||||
.. function:: redirect(to[, permanent=False], *args, **kwargs)
|
||||
|
||||
.. versionadded:: 1.1
|
||||
|
||||
Returns an :class:`~django.http.HttpResponseRedirect` to the appropriate URL
|
||||
for the arguments passed.
|
||||
|
||||
|
||||
@@ -225,8 +225,6 @@ The remaining arguments should be tuples in this format::
|
||||
url
|
||||
---
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
.. function:: url(regex, view, kwargs=None, name=None, prefix='')
|
||||
|
||||
You can use the ``url()`` function, instead of a tuple, as an argument to
|
||||
@@ -285,8 +283,6 @@ include
|
||||
A function that takes a full Python import path to another URLconf module that
|
||||
should be "included" in this place.
|
||||
|
||||
.. versionadded:: 1.1
|
||||
|
||||
:func:`include` also accepts as an argument an iterable that returns URL
|
||||
patterns.
|
||||
|
||||
@@ -417,8 +413,6 @@ Django encounters ``include()``, it chops off whatever part of the URL matched
|
||||
up to that point and sends the remaining string to the included URLconf for
|
||||
further processing.
|
||||
|
||||
.. versionadded:: 1.1
|
||||
|
||||
Another possibility is to include additional URL patterns not by specifying the
|
||||
URLconf Python module defining them as the `include`_ argument but by using
|
||||
directly the pattern list as returned by `patterns`_ instead. For example::
|
||||
@@ -637,8 +631,6 @@ the view prefix (as explained in "The view prefix" above) will have no effect.
|
||||
Naming URL patterns
|
||||
===================
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
It's fairly common to use the same view function in multiple URL patterns in
|
||||
your URLconf. For example, these two URL patterns both point to the ``archive``
|
||||
view::
|
||||
@@ -697,8 +689,6 @@ not restricted to valid Python names.
|
||||
URL namespaces
|
||||
--------------
|
||||
|
||||
.. versionadded:: 1.1
|
||||
|
||||
Namespaced URLs are specified using the ``:`` operator. For example, the main
|
||||
index page of the admin application is referenced using ``admin:index``. This
|
||||
indicates a namespace of ``admin``, and a named URL of ``index``.
|
||||
@@ -804,8 +794,6 @@ vertical bar (``"|"``) character. You can quite happily use such patterns for
|
||||
matching against incoming URLs and sending them off to views, but you cannot
|
||||
reverse such patterns.
|
||||
|
||||
.. versionadded:: 1.1
|
||||
|
||||
The ``current_app`` argument allows you to provide a hint to the resolver
|
||||
indicating the application to which the currently executing view belongs.
|
||||
This ``current_app`` argument is used as a hint to resolve application
|
||||
@@ -935,8 +923,6 @@ get_script_prefix()
|
||||
|
||||
.. function:: get_script_prefix()
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
Normally, you should always use :func:`~django.core.urlresolvers.reverse` or
|
||||
:func:`~django.db.models.permalink` to define URLs within your application.
|
||||
However, if your application constructs part of the URL hierarchy itself, you
|
||||
|
||||
@@ -81,12 +81,8 @@ following this algorithm:
|
||||
|
||||
* Failing that, it looks for a cookie.
|
||||
|
||||
.. versionchanged:: 1.0
|
||||
|
||||
In Django version 0.96 and before, the cookie's name is hard-coded to
|
||||
``django_language``. In Django 1,0, The cookie name is set by the
|
||||
``LANGUAGE_COOKIE_NAME`` setting. (The default name is
|
||||
``django_language``.)
|
||||
The name of the cookie used is set by the ``LANGUAGE_COOKIE_NAME``
|
||||
setting. (The default name is ``django_language``.)
|
||||
|
||||
* Failing that, it looks at the ``Accept-Language`` HTTP header. This
|
||||
header is sent by your browser and tells the server which language(s) you
|
||||
|
||||
@@ -5,9 +5,6 @@ Pagination
|
||||
.. module:: django.core.paginator
|
||||
:synopsis: Classes to help you easily manage paginated data.
|
||||
|
||||
.. versionchanged:: 1.0
|
||||
Pagination facilities have been almost fully reworked.
|
||||
|
||||
Django provides a few classes that help you manage paginated data -- that is,
|
||||
data that's split across several pages, with "Previous/Next" links. These
|
||||
classes live in :file:`django/core/paginator.py`.
|
||||
|
||||
@@ -403,8 +403,6 @@ wouldn't know which one of the blocks' content to use.
|
||||
Automatic HTML escaping
|
||||
=======================
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
When generating HTML from templates, there's always a risk that a variable will
|
||||
include characters that affect the resulting HTML. For example, consider this
|
||||
template fragment::
|
||||
|
||||
@@ -288,9 +288,6 @@ with this command::
|
||||
|
||||
Note that we used ``animals``, not ``myproject.animals``.
|
||||
|
||||
.. versionadded:: 1.0
|
||||
You can now choose which test to run.
|
||||
|
||||
You can be even *more* specific by naming an individual test case. To
|
||||
run a single test case in an application (for example, the
|
||||
``AnimalTestCase`` described in the "Writing unit tests" section), add
|
||||
@@ -393,8 +390,6 @@ database is created by the user specified by ``USER``, so you'll need
|
||||
to make sure that the given user account has sufficient privileges to
|
||||
create a new database on the system.
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
For fine-grained control over the character encoding of your test
|
||||
database, use the :setting:`TEST_CHARSET` option. If you're using
|
||||
MySQL, you can also use the :setting:`TEST_COLLATION` option to
|
||||
@@ -718,8 +713,6 @@ arguments at time of construction:
|
||||
details view, which is a good way to test code paths that use the
|
||||
:meth:`django.http.HttpRequest.is_ajax()` method.
|
||||
|
||||
.. versionadded:: 1.1
|
||||
|
||||
If you already have the GET arguments in URL-encoded form, you can
|
||||
use that encoding instead of using the data argument. For example,
|
||||
the previous GET request could also be posed as::
|
||||
@@ -802,8 +795,6 @@ arguments at time of construction:
|
||||
|
||||
The ``extra`` argument acts the same as for :meth:`Client.get`.
|
||||
|
||||
.. versionchanged:: 1.1
|
||||
|
||||
If the URL you request with a POST contains encoded parameters, these
|
||||
parameters will be made available in the request.GET data. For example,
|
||||
if you were to make the request::
|
||||
@@ -820,8 +811,6 @@ arguments at time of construction:
|
||||
|
||||
.. method:: Client.head(path, data={}, follow=False, **extra)
|
||||
|
||||
.. versionadded:: 1.1
|
||||
|
||||
Makes a HEAD request on the provided ``path`` and returns a ``Response``
|
||||
object. Useful for testing RESTful interfaces. Acts just like
|
||||
:meth:`Client.get` except it does not return a message body.
|
||||
@@ -832,8 +821,6 @@ arguments at time of construction:
|
||||
|
||||
.. method:: Client.options(path, data={}, follow=False, **extra)
|
||||
|
||||
.. versionadded:: 1.1
|
||||
|
||||
Makes an OPTIONS request on the provided ``path`` and returns a
|
||||
``Response`` object. Useful for testing RESTful interfaces.
|
||||
|
||||
@@ -845,8 +832,6 @@ arguments at time of construction:
|
||||
|
||||
.. method:: Client.put(path, data={}, content_type=MULTIPART_CONTENT, follow=False, **extra)
|
||||
|
||||
.. versionadded:: 1.1
|
||||
|
||||
Makes a PUT request on the provided ``path`` and returns a
|
||||
``Response`` object. Useful for testing RESTful interfaces. Acts just
|
||||
like :meth:`Client.post` except with the PUT request method.
|
||||
@@ -857,8 +842,6 @@ arguments at time of construction:
|
||||
|
||||
.. method:: Client.delete(path, follow=False, **extra)
|
||||
|
||||
.. versionadded:: 1.1
|
||||
|
||||
Makes an DELETE request on the provided ``path`` and returns a
|
||||
``Response`` object. Useful for testing RESTful interfaces.
|
||||
|
||||
@@ -870,8 +853,6 @@ arguments at time of construction:
|
||||
|
||||
.. method:: Client.login(**credentials)
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
If your site uses Django's :doc:`authentication system</topics/auth>`
|
||||
and you deal with logging in users, you can use the test client's
|
||||
``login()`` method to simulate the effect of a user logging into the
|
||||
@@ -916,8 +897,6 @@ arguments at time of construction:
|
||||
|
||||
.. method:: Client.logout()
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
If your site uses Django's :doc:`authentication system</topics/auth>`,
|
||||
the ``logout()`` method can be used to simulate the effect of a user
|
||||
logging out of your site.
|
||||
@@ -956,8 +935,6 @@ Specifically, a ``Response`` object has the following attributes:
|
||||
If the rendered page used multiple templates, then ``context`` will be a
|
||||
list of ``Context`` objects, in the order in which they were rendered.
|
||||
|
||||
.. versionadded:: 1.1
|
||||
|
||||
Regardless of the number of templates used during rendering, you can
|
||||
retrieve context values using the ``[]`` operator. For example, the
|
||||
context variable ``name`` could be retrieved using::
|
||||
@@ -1127,8 +1104,6 @@ just change the base class of your test from ``unittest.TestCase`` to
|
||||
will continue to be available, but it will be augmented with some useful
|
||||
additions.
|
||||
|
||||
.. versionadded:: 1.1
|
||||
|
||||
.. class:: TransactionTestCase()
|
||||
|
||||
Django ``TestCase`` classes make use of database transaction facilities, if
|
||||
@@ -1176,8 +1151,6 @@ by truncating tables and reloading initial data.
|
||||
Default test client
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
.. attribute:: TestCase.client
|
||||
|
||||
Every test case in a ``django.test.TestCase`` instance has access to an
|
||||
@@ -1305,8 +1278,6 @@ or by the order of test execution.
|
||||
URLconf configuration
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
.. attribute:: TestCase.urls
|
||||
|
||||
If your application provides views, you may want to include tests that use the
|
||||
@@ -1374,8 +1345,6 @@ This test case will flush *all* the test databases before running
|
||||
Emptying the test outbox
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
If you use Django's custom ``TestCase`` class, the test runner will clear the
|
||||
contents of the test e-mail outbox at the start of each test case.
|
||||
|
||||
@@ -1384,8 +1353,6 @@ For more detail on e-mail services during tests, see `E-mail services`_.
|
||||
Assertions
|
||||
~~~~~~~~~~
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
.. versionchanged:: 1.2
|
||||
Addded ``msg_prefix`` argument.
|
||||
|
||||
@@ -1444,8 +1411,6 @@ cause of an failure in your test suite.
|
||||
redirected to ``expected_url`` (including any GET data), and the final
|
||||
page was received with ``target_status_code``.
|
||||
|
||||
.. versionadded:: 1.1
|
||||
|
||||
If your request used the ``follow`` argument, the ``expected_url`` and
|
||||
``target_status_code`` will be the url and status code for the final
|
||||
point of the redirect chain.
|
||||
@@ -1496,8 +1461,6 @@ cause of an failure in your test suite.
|
||||
E-mail services
|
||||
---------------
|
||||
|
||||
.. versionadded:: 1.0
|
||||
|
||||
If any of your Django views send e-mail using :doc:`Django's e-mail
|
||||
functionality </topics/email>`, you probably don't want to send e-mail each time
|
||||
you run a test using that view. For this reason, Django's test runner
|
||||
@@ -1801,9 +1764,6 @@ also provides some utilities that can be useful during testing.
|
||||
:setting:`NAME` in :setting:`DATABASES` to match the name of the test
|
||||
database.
|
||||
|
||||
.. versionchanged:: 1.0
|
||||
``create_test_db()`` now returns the name of the test database.
|
||||
|
||||
.. function:: destroy_test_db(old_database_name, verbosity=1)
|
||||
|
||||
Destroys the database whose name is in stored in :setting:`NAME` in the
|
||||
|
||||
Reference in New Issue
Block a user