summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBrian Rosner <brosner@gmail.com>2008-06-23 21:05:02 +0000
committerBrian Rosner <brosner@gmail.com>2008-06-23 21:05:02 +0000
commit420f19aa353ee6568c93f34dfe2e6eef24bc528d (patch)
tree12f182ec4f958ac08a57f05786fdbefabae9910c /docs
parentc929440fcd001b97b805f2229fb85deae3f86e05 (diff)
newforms-admin: Merged from trunk up to [7729].
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7730 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/contributing.txt45
-rw-r--r--docs/db-api.txt2
-rw-r--r--docs/model-api.txt4
-rw-r--r--docs/modelforms.txt7
4 files changed, 48 insertions, 10 deletions
diff --git a/docs/contributing.txt b/docs/contributing.txt
index c5f98bec11..b73e3601bc 100644
--- a/docs/contributing.txt
+++ b/docs/contributing.txt
@@ -702,13 +702,8 @@ Django tarball. It's our policy to make sure all tests pass at all times.
The tests cover:
* Models and the database API (``tests/modeltests/``).
- * The cache system (``tests/regressiontests/cache.py``).
- * The ``django.utils.dateformat`` module (``tests/regressiontests/dateformat/``).
- * Database typecasts (``tests/regressiontests/db_typecasts/``).
- * The template system (``tests/regressiontests/templates/`` and
- ``tests/regressiontests/defaultfilters/``).
- * ``QueryDict`` objects (``tests/regressiontests/httpwrappers/``).
- * Markup template tags (``tests/regressiontests/markup/``).
+ * Everything else in core Django code (``tests/regressiontests``)
+ * Contrib apps (``django/contrib/<contribapp>/tests``, see below)
We appreciate any and all contributions to the test suite!
@@ -744,6 +739,26 @@ If you're using another backend:
deleted when the tests are finished. This means your user account needs
permission to execute ``CREATE DATABASE``.
+If you want to run the full suite of tests, there are a number of dependencies that
+you should install:
+
+ * PyYAML_
+ * Markdown_
+ * Textile_
+ * Docutils_
+ * setuptools_
+
+Of these dependencies, setuptools_ is the only dependency that is required - if
+setuptools_ is not installed, you will get import errors when running one of
+the template tests. The tests using the other libraries will be skipped if the
+dependency can't be found.
+
+.. _PyYAML: http://pyyaml.org/wiki/PyYAML
+.. _Markdown: http://pypi.python.org/pypi/Markdown/1.7
+.. _Textile: http://pypi.python.org/pypi/textile
+.. _docutils: http://pypi.python.org/pypi/docutils/0.4
+.. _setuptools: http://pypi.python.org/pypi/setuptools/
+
To run a subset of the unit tests, append the names of the test modules to the
``runtests.py`` command line. See the list of directories in
``tests/modeltests`` and ``tests/regressiontests`` for module names.
@@ -755,6 +770,22 @@ for generic relations and internationalization, type::
PYTHONPATH=..
./runtests.py --settings=settings generic_relations i18n
+Contrib apps
+------------
+
+Tests for apps in ``django/contrib/`` go in their respective directories,
+in a ``tests.py`` file. (You can split the tests over multiple modules
+by using a ``tests`` folder in the normal Python way).
+
+For the tests to be found, a ``models.py`` file must exist (it doesn't
+have to have anything in it). If you have URLs that need to be
+mapped, you must add them in ``tests/urls.py``.
+
+To run tests for just one contrib app (e.g. ``markup``), use the same
+method as above::
+
+ ./runtests.py --settings=settings markup
+
Requesting features
===================
diff --git a/docs/db-api.txt b/docs/db-api.txt
index 4e1c2c5791..3202bd4f9f 100644
--- a/docs/db-api.txt
+++ b/docs/db-api.txt
@@ -1382,7 +1382,7 @@ and then converted into a query using the ``query`` attribute::
This queryset will be evaluated as subselect statement::
- SELET ... WHERE blog.id IN (SELECT id FROM ... WHERE NAME LIKE '%Cheddar%')
+ SELECT ... WHERE blog.id IN (SELECT id FROM ... WHERE NAME LIKE '%Cheddar%')
startswith
~~~~~~~~~~
diff --git a/docs/model-api.txt b/docs/model-api.txt
index 314c8ea4b5..6dc2d0835a 100644
--- a/docs/model-api.txt
+++ b/docs/model-api.txt
@@ -648,8 +648,8 @@ Django will automatically add this field::
Thus, you don't need to set ``primary_key=True`` on any of your fields
unless you want to override the default primary-key behavior.
-``primary_key=True`` implies ``blank=False``, ``null=False`` and
-``unique=True``. Only one primary key is allowed on an object.
+``primary_key=True`` implies ``null=False`` and ``unique=True``. Only
+one primary key is allowed on an object.
``unique``
~~~~~~~~~~
diff --git a/docs/modelforms.txt b/docs/modelforms.txt
index fae860944e..5cff11fdeb 100644
--- a/docs/modelforms.txt
+++ b/docs/modelforms.txt
@@ -182,6 +182,13 @@ supplied, ``save()`` will update that instance. If it's not supplied,
# Create a form to edit an existing Article.
>>> a = Article.objects.get(pk=1)
>>> f = ArticleForm(instance=a)
+ >>> f.save()
+
+ # Create a form to edit an existing Article, but use
+ # POST data to populate the form.
+ >>> a = Article.objects.get(pk=1)
+ >>> f = ArticleForm(request.POST, instance=a)
+ >>> f.save()
Note that ``save()`` will raise a ``ValueError`` if the data in the form
doesn't validate -- i.e., ``if form.errors``.