1
0
mirror of https://github.com/django/django.git synced 2025-08-21 01:09:13 +00:00

Moved manual testing instructions from intro to submitting patches docs.

The section on manual testing, including how to use a local checkout of
Django, is moved from the contribution intro to the submitting patches
docs. This makes it easier for reviewers and authors to follow best
practices.
This commit is contained in:
Jordan Bae 2025-01-19 00:29:14 +09:00 committed by nessita
parent 45ba7683a6
commit fdeca38072
2 changed files with 22 additions and 17 deletions

View File

@ -317,6 +317,25 @@ utilities, such as a ``@deprecate_posargs`` decorator to assist with converting
positional-or-keyword arguments to keyword-only. See the inline documentation positional-or-keyword arguments to keyword-only. See the inline documentation
in the module source. in the module source.
Testing with a Django project
=============================
It's important to test local changes using a Django project. This allows
ensuring that the changes behave as expected in a real environment, especially
for user-facing features such as templates, forms, or the admin.
To do this:
#. Create a virtual environment and :ref:`install the cloned copy of Django in
editable mode <intro-contributing-install-local-copy>`.
#. Set up a Django project outside the source tree (you can use the :doc:`first
part of the tutorial </intro/tutorial01>` for guidance).
With this setup, any changes made to the Django checkout will take effect
immediately in the test project, allowing manual testing of contributions
against a new or existing app.
JavaScript contributions JavaScript contributions
======================== ========================

View File

@ -132,6 +132,8 @@ that they don't interfere with each other.
It's a good idea to keep all your virtual environments in one place, for It's a good idea to keep all your virtual environments in one place, for
example in ``.virtualenvs/`` in your home directory. example in ``.virtualenvs/`` in your home directory.
.. _intro-contributing-install-local-copy:
Create a new virtual environment by running: Create a new virtual environment by running:
.. console:: .. console::
@ -168,8 +170,6 @@ command line to help you keep track of which one you are using. Anything you
install through ``pip`` while this name is displayed will be installed in that install through ``pip`` while this name is displayed will be installed in that
virtual environment, isolated from other environments and system-wide packages. virtual environment, isolated from other environments and system-wide packages.
.. _intro-contributing-install-local-copy:
Go ahead and install the previously cloned copy of Django: Go ahead and install the previously cloned copy of Django:
.. console:: .. console::
@ -178,21 +178,7 @@ Go ahead and install the previously cloned copy of Django:
The installed version of Django is now pointing at your local copy by installing The installed version of Django is now pointing at your local copy by installing
in editable mode. You will immediately see any changes you make to it, which is in editable mode. You will immediately see any changes you make to it, which is
of great help when writing your first contribution. of great help when testing your first contribution.
Creating projects with a local copy of Django
---------------------------------------------
It may be helpful to test your local changes with a Django project. First you
have to create a new virtual environment, :ref:`install the previously cloned
local copy of Django in editable mode <intro-contributing-install-local-copy>`,
and create a new Django project outside of your local copy of Django. You will
immediately see any changes you make to Django in your new project, which is
of great help when writing your first contribution, especially if testing
any changes to the UI.
You can follow the :doc:`tutorial</intro/tutorial01>` for help in creating a
Django project.
Running Django's test suite for the first time Running Django's test suite for the first time
============================================== ==============================================