Finally began proofreading docs/testing.txt. Did the intro for now; more to come
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5153 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
36b164d838
commit
3d52993b46
|
@ -2,19 +2,29 @@
|
||||||
Testing Django applications
|
Testing Django applications
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
Automated testing is an extremely useful weapon in the bug-killing arsenal
|
Automated testing is an extremely useful bug-killing tool for the modern
|
||||||
of the modern developer. When initially writing code, a test suite can be
|
Web developer. You can use a collection of tests -- a **test suite** -- to
|
||||||
used to validate that code behaves as expected. When refactoring or
|
to solve, or avoid, a number of problems:
|
||||||
modifying code, tests serve as a guide to ensure that behavior hasn't
|
|
||||||
changed unexpectedly as a result of the refactor.
|
|
||||||
|
|
||||||
Testing a web application is a complex task, as there are many
|
* When you're writing new code, you can use tests to validate your code
|
||||||
components of a web application that must be validated and tested. To
|
works as expected.
|
||||||
help you test your application, Django provides a test execution
|
|
||||||
framework, and range of utilities that can be used to simulate and
|
|
||||||
inspect various facets of a web application.
|
|
||||||
|
|
||||||
This testing framework is currently under development, and may change
|
* When you're refactoring or modifying old code, you can use tests to
|
||||||
|
ensure your changes haven't affected your application's behavior
|
||||||
|
unexpectedly.
|
||||||
|
|
||||||
|
Testing a Web application is a complex task, because a Web application is made
|
||||||
|
of several layers of logic -- from HTTP-level request handling, to form
|
||||||
|
validation and processing, to template rendering. With Django's test-execution
|
||||||
|
framework and assorted utilities, you can simulate requests, insert test data,
|
||||||
|
inspect your application's output and generally verify your code is doing what
|
||||||
|
it should be doing.
|
||||||
|
|
||||||
|
The best part is, it's really easy.
|
||||||
|
|
||||||
|
.. admonition:: Note
|
||||||
|
|
||||||
|
This testing framework is currently under development. It may change
|
||||||
slightly before the next official Django release.
|
slightly before the next official Django release.
|
||||||
|
|
||||||
(That's *no* excuse not to write tests, though!)
|
(That's *no* excuse not to write tests, though!)
|
||||||
|
|
Loading…
Reference in New Issue