Fixed #33026 -- Mentioned RequestFactory in testing tools docs.

This commit is contained in:
Chris Wedgwood 2022-09-29 04:58:45 +01:00 committed by GitHub
parent 0f5b11eca0
commit 468d061097
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -34,12 +34,15 @@ short:
* Use Django's test client to establish that the correct template is being * Use Django's test client to establish that the correct template is being
rendered and that the template is passed the correct context data. rendered and that the template is passed the correct context data.
* Use :class:`~django.test.RequestFactory` to test view functions directly,
bypassing the routing and middleware layers.
* Use in-browser frameworks like Selenium_ to test *rendered* HTML and the * Use in-browser frameworks like Selenium_ to test *rendered* HTML and the
*behavior* of web pages, namely JavaScript functionality. Django also *behavior* of web pages, namely JavaScript functionality. Django also
provides special support for those frameworks; see the section on provides special support for those frameworks; see the section on
:class:`~django.test.LiveServerTestCase` for more details. :class:`~django.test.LiveServerTestCase` for more details.
A comprehensive test suite should use a combination of both test types. A comprehensive test suite should use a combination of all of these test types.
Overview and a quick example Overview and a quick example
---------------------------- ----------------------------